-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Search request not returning JSON #61
Comments
This is just a warning message (see https://docs.python.org/3.1/library/logging.html). Are you getting a traceback? I suspect that your code is executing. |
Yes , Here is my traceback:
|
This has nothing to do with logger warning that you are getting. It seems that the search request is not returning json. It may be that okcupid changed the search uri/request format. Let me take a look. |
Just tried things out and they are working for me. Can you run this using the okcupyd command with the --enable-logger='okcupyd.search' flag set? and paste the output? |
You can also just add from okcupyd.util import enable_logger
enable_logger('okcupyd.search') to the beggining of your script. |
I enabled the logger and reran the script. It's really hard to capture the entire message because the html output. Here is the first lines, the rest is html folowed by the json error. /Users/mosesmccall/.virtualenvs/love_machine/lib/python2.7/site-packages/requests/packages/urllib3/util/ssl_.py:79: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning. Also I looked at the I return object of the search method, here it is: <Fetchable[FetchMarshall(SearchHTMLFetcher({'gentation': 'girls who like guys', 'radius': 25, 'age_min': 26, 'age_max': 32}), <SimpleProcessor(<function at 0x10bfe5f50>, XPathBuilder(".//div[ contains(concat(' ',normalize-space(@Class),' '),' match_card ') ]"))>)][]> |
hmmm. I need to see the contents of that failure object. Are you on osx? Can you just pipe the output to pbcopy or gist? |
The warning you are getting is concerning as well. are you able to do anything else? Maybe logging in is failing silently in some strange way? |
Here is the entire output Since I created a dummy test account, I used this username password. u:marsarasaurus For you to repeat the problem 2015-07-06 00:36:27 qed okcupyd.search[67676] INFO {"search_parameters": {"fromWhoOnline": "0", "locid": "4356642", "sort_type": "0", "filter1": "2,26,32", "filter3": "0,34", "filter2": "3,25", "ajax_load": 1, "count": 9, "discard_prefs": 1, "timekey": 1, "custom_search": "0", "update_prefs": "1", "low": 1, "matchOrderBy": "MATCH", "mygender": "M", "sa": "1", "match_card_class": "just_appended"}} Cut to the chase<div class="desc"> You know what you want, and we can help you find it.
<button class="no-thanks"> No thanks <div class="drag_area"> <div class="top"> <div class="left"> <div class="right"> <div class="bottom"> <a class="close" href="javascript:void(0)" onclick="Modal.close('matchsearch-alist-modal')"> <span class="icon i-close"> <div id="match-filters-wrapper"> <div id="main_content" class="page-section"> <div class="monolith"> <div id="match-results-wrapper"> <div class="match-results match-results-loading"> <footer class="page-section"> <div id="footer" class="container_16 clearfix"> <ul id="footer_nav"> \n\t\t\t\t\t<%- userinfo.username %>\n\t\t\t\t\n\n\t\t\t\t<a href="#" class="maximize">\n\n\t\t\t\t<div class="controls">\n\t\t\t\t\t<a href="#" class="close">\n\t\t\t\t\t\t<i class="icon i-close">\n\t\t\t\t\t\n\t\t\t\t\n\n\t\t\t\n\t\t\n\t</script>\n\n\t\n\t<script type="text/template" id="global_messaging_header" class="hidden">\n\t\t<div class="header old_template">\n\t\t\t<a href="/profile/<%- userinfo.username %>">\n\t\t\t\t<div class="image" data-profile-popover data-username="<%- userinfo.username %>">\n\t\t\t\t\t<img src="<%- userinfo.image %>" alt="An image of <%- userinfo.username %>" />\n\t\t\t\t\t<% if (userinfo.is_online) { %>\n\t\t\t\t\t\t<span class="online">online now!\n\t\t\t\t\t<% } %>\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t<%- userinfo.username %>\n\t\t\t\t\n\t\t\t\n\n\t\t\t<div class="controls">\n\t\t\t\t<a href="#" class="options">\n\t\t\t\t\t<i class="icon i-ellipsis-v">\n\t\t\t\t\n\t\t\t\t<a href="#" class="minimize">\n\t\t\t\t\t<i class="icon i-minimize">\n\t\t\t\t\n\t\t\t\t<a href="#" class="close">\n\t\t\t\t\t<i class="icon i-close">\n\t\t\t\t\n\t\t\t\t<div class="popover arrowup alignleft">\n\t\t\t\t\t<div class="contents">\n\t\t\t\t\t\t<a class="block" href="#">Block them\n\t\t\t\t\t\t<a class="flag" href="#">Report a message\n\t\t\t\t\t\n\t\t\t\t\t<div class="tail">\n\t\t\t\t\n\t\t\t\n\n\t\t\t<div class="border">\n\t\t\n\t</script>\n\n\t\n\t\n\n\t<script type="text/template" id="global_messaging_message_meta" class="hidden">\n\t\t\n\t\t<% if (message.im || message.read) { %>\n\t\t\t<div class="message_meta <%- message.meta_classes %>">\n\t\t\t\t<% if (message.im) { %>\n\t\t\t\t\t<span class="im_note">Sent from chat\n\t\t\t\t<% } %>\n\t\t\t\t<% if (message.read) { %>\n\t\t\t\t\t<span class="read_receipt">\n\t\t\t\t\t\t<span class="icon i-checkmark">\n\t\t\t\t\t\tRead\n\t\t\t\t\t\n\t\t\t\t<% } %>\n\t\t\t\n\t\t<% } %>\n\t\n\t</script>\n\n\t\n\t\n\n\t<script type="text/template" id="global_messaging_message" class="hidden">\n\t\t\n\t\t\n\t\t\t\t\tWarning: Never transfer funds to someone you met on\n\t\t\t\t\tthe Internet and keep your conversations safely on OkCupid. <a href="#"\n\t\t\t\t\tclass="scam_warning_more_info">More info\n\t\t\t\t \n\t\t\t\n\t\t<% } %>\n\t\t<% _.each(messages, function(message, key, list) { %>\n\t\t\t<% if (!message.hidden) { %>\n\t\t\t\t\n\t\t\n\t\t\tThis will prevent further communication between you and them.\n\t\t\t<span class="modal_error hidden">Something went wrong. Please refresh and try again.\n\t\t \n\t\t\n\t\n\n\n\t<div class="content empty">\n\t\t\n\t\n\n\t\n\n\t<div class="drag_area">\n\t\t<div class="top">\n\t\t<div class="left">\n\t\t<div class="right">\n\t\t<div class="bottom">\n\t\n\n\t<a class="close" href="javascript:void(0)" onclick="Modal.close('global_messaging_block_modal')">\n\t\t<span class="icon i-close">\n\t\n\n\t\n\t\t<div class="buttons">\n\t\t\t
You can unblock someone from their profile.\n\t\t\n\t\t\n\t\n\n\t\n\n\t<div class="drag_area">\n\t\t<div class="top">\n\t\t<div class="left">\n\t\t<div class="right">\n\t\t<div class="bottom">\n\t\n\n\t<a class="close" href="javascript:void(0)" onclick="Modal.close('global_messaging_block_success')">\n\t\t<span class="icon i-close">\n\t\n\n\t\n\t\t<div class="buttons">\n\t\t\t
\n\t\t\tso you won’t have to deal with them again.\n\t\t\n\t\t\n\t\n\n\t\n\n\t<div class="drag_area">\n\t\t<div class="top">\n\t\t<div class="left">\n\t\t<div class="right">\n\t\t<div class="bottom">\n\t\n\n\t<a class="close" href="javascript:void(0)" onclick="Modal.close('global_messaging_flag_success')">\n\t\t<span class="icon i-close">\n\t\n\n\t\n\t\t<div class="buttons">\n\t\t\t
\n\t\t\t
Are you sure you want to delete this album? <div class="content "> <button id="album_delete_submit" class="flatbutton red">Delete <button id="album_delete_cancel" class="flatbutton silver">Cancel <div class="tail"> <span class="counter"> <div class="photo"> <img id="okphotos_main_photo" src=""/> <div class="description"> <div class="controls_actions_wrapper"> <div class="actions"> <div id="okphotos_description_form" class="description_actions okform"> <textarea id="okphotos_edit_description" placeholder="Add a caption"></textarea> <button id="okphotos_edit_description_confirm" class="flatbutton blue">Save <button id="okphotos_edit_description_cancel" class="flatbutton silver">Cancel <div class="delete_actions"> <button id="okphotos_delete_confirm" class="flatbutton red">Delete <button id="okphotos_delete_cancel" class="flatbutton silver">Cancel <div class="crop_actions"> <button id="okphotos_crop_confirm" class="flatbutton blue">Save <button id="okphotos_crop_cancel" class="flatbutton silver">Cancel <div class="photo_controls controls"> <a href="javascript:void(0)" id="okphotos_edit_photo" class="edit"> <i class="icon"> <a href="javascript:void(0)" id="okphotos_recrop_photo" class="recrop"> <i class="icon"> <a href="javascript:void(0)" id="okphotos_delete_photo" class="delete"> <i class="icon"> <a href="javascript:void(0)" id="okphotos_report_photo" class="report"> Report photo <div id="okphotos_action_area"> <div id="okphotos_upload" class="action"> <div class="action_content"> <h3 class="title">Where's your photo? <div id="service_picker"> <div class="picker_wrapper"> <div class="services"> <a id="service_facebook" class="service" href="javascript:void(0)"> <i class="icon i-facebook-inverted"> <div class="label">Facebook <form id="okphotos_upload_form" action="/ajaxuploader" method="POST"> <label id="service_computer" class="service" for="okphotos_file_input"> <i class="icon i-pc"> <div class="label"> <span class="pc_only">My PC <span class="mac_only">My Mac <input type="file" value="Upload" id="okphotos_file_input" name="file" accept="image/*"/> <input type="hidden" name="userid" value="13568020090150630457" /> <input type="hidden" name="simple_ajax" value="1" /> <a id="service_instagram" class="service" href="javascript:void(0)"> <i class="icon i-instagram"> <div class="label">Instagram <div id="iframe_container"> <p class="dragndrop_message"> Drop it like it\u2019s hot <div id="okphotos_dragndrop"> <div id="okphotos_rules" class="user_tips"> Photos need to be larger 400 x 400px and you need to be in the photo. Also, no naughty bits! <div id="okphotos_photo_tiles" class="action"> <div id="photo_tiles_header" class="action_header"> <div class="title" href="javascript:void(0)"> <a class="subtitle" href="javascript:void(0)"> <div class="action_content has_header has_footer"> <div id="photo_tile_holder" class="tile_holder"> <div id="photo_subtile_holder" class="tile_holder"> <div id="photo_tiles_loader"> <div class="icon"> <div class="action_footer"> <button id="photo_tiles_done" class="flatbutton green disabled">Next <div id="okphotos_edit" class="action"> <div class="action_header"> <div class="crop_header"> <div class="title">Edit thumbnail <div class="caption_header"> <div class="title">Add a caption <div class="action_content has_header has_footer"> <div id="okphotos_edit_wrapper"> <img id="okphotos_photo"/> <div id="okphotos_edit_actions" class="action_footer okform"> <textarea id="photo_caption" placeholder="Say something about your photo" maxlength="100"></textarea> <a id="okphotos_edit_next" class="flatbutton green">Done <div id="okphotos_finished" class="action"> <div class="content"> <div class="action_content"> <div class="reassurance">You look great! <img id="okphotos_cropped_photo"/> <button id="upload_another" class="flatbutton blue"> Add more <a href="javascript:;" id="done_uploading"> I\u2019m Done <div id="okphotos_error" class="action"> <div class="action_content"> <div class="content"> <div class="container"> <div class="error_icon"> <i class="icon i-alert"> <div class="message"> <button class="flatbutton white">Try again <a id="okphotos_action_close" href="javascript:void(0)"> <i class="icon i-close"> <script>\n\tOkPhotos.initialize({\n\t\tuserid: '13568020090150630457',\n\t\tauthcode: '1,0,1436243304,0xbc4b4a62b2cab439;321b53cb77f9883e1208f23bc5a268c7353162dd'\n\t});\n\tOkPhotos.setPhotoCount(0);\n\n\t\n</script> <div id="mutual_match_modal" class="modal aligncenter noclose mutual_match_modal default_type"> <div class="title_container"> <h2 class="title">They like you back! <div class="desc">Now’s the perfect time to send them a message! <div class="content "> <div class="userpic theirs"> <img class="hide" src="" alt="A picture of staffrobot"> <div class="userpic users"> <img src="http://k1.okccdn.com/media/img/user/placeholder_2013/pq_160.png\" alt="A picture of marsarasaurus"> <div class="drag_area"> <div class="top"> <div class="left"> <div class="right"> <div class="bottom"> <a class="close" href="javascript:void(0)" onclick="Modal.close('mutual_match_modal')"> <span class="icon i-close"> <div class="buttons">
Go incognito! <p class="incognito-modal-body">Your profile will only be visible to people you like or message. <div class="incognito-modal-slide"> <h2 class="incognito-modal-head">See but don’t be seen. It’s that simple. <p class="incognito-modal-body">Browse freely, your profile won’t appear anywhere—not even in search. <div class="incognito-modal-slide"> <h2 class="incognito-modal-head">You’re always in complete control. <p class="incognito-modal-body">Revoke a person’s access to your profile by unliking or hiding them. <div class="incognito-modal-slide"> <h2 class="incognito-modal-head">Craving a bit more attention? <p class="incognito-modal-body">We get it. Turn Incognito Mode on and off whenever you want! <div class="incognito-modal-carousel-nav"> <button class="incognito-modal-carousel-nav-button" data-index="0"> <button class="incognito-modal-carousel-nav-button" data-index="1"> <button class="incognito-modal-carousel-nav-button" data-index="2"> <button class="incognito-modal-carousel-nav-button" data-index="3"> <div class="incognito-modal-right"> <form class="incognito-modal-form okform"> <label id="incognito-plan-label-10" for="incognito-plan-10" class="incognito-plan incognito-plan-1"> <input type="radio" id="incognito-plan-10" name="incognito-plan" value="10" /> 1 month at $19.95 / mo <label id="incognito-plan-label-14" for="incognito-plan-14" class="incognito-plan incognito-plan-3"> <input type="radio" id="incognito-plan-14" name="incognito-plan" value="14" /> 3 months at $14.95 / mo <label id="incognito-plan-label-18" for="incognito-plan-18" class="incognito-plan incognito-plan-6"> <input type="radio" id="incognito-plan-18" name="incognito-plan" value="18" /> 6 months at $9.95 / mo <div class="buttons">
Get a full day of activity |
\n\t\t\t\t\t\t\t<img src="<%= person.image %>" class="user_image <%= person.image_class %>" width="82" height="82" alt="An image of <%= person.username %>" />\n\t\t\t\t\t\t |
Traceback (most recent call last):
File "okc.py", line 11, in
for profile in profiles[:10]:
File "/Users/mosesmccall/.virtualenvs/love_machine/lib/python2.7/site-packages/okcupyd/util/fetchable.py", line 192, in getitem
return self._handle_slice(item)
File "/Users/mosesmccall/.virtualenvs/love_machine/lib/python2.7/site-packages/okcupyd/util/fetchable.py", line 218, in _handle_slice
value = next(iterator)
File "/Users/mosesmccall/.virtualenvs/love_machine/lib/python2.7/site-packages/okcupyd/util/fetchable.py", line 164, in _make_nice_repr_iterator
for item in original_iterable:
File "/Users/mosesmccall/.virtualenvs/love_machine/lib/python2.7/site-packages/okcupyd/util/fetchable.py", line 282, in fetch
text_response = self._fetcher.fetch(start_at=pos)
File "/Users/mosesmccall/.virtualenvs/love_machine/lib/python2.7/site-packages/okcupyd/search.py", line 281, in fetch
search_html = response.json()['html']
File "/Users/mosesmccall/.virtualenvs/love_machine/lib/python2.7/site-packages/requests/models.py", line 802, in json
return json.loads(self.text, **kwargs)
File "/Users/mosesmccall/.virtualenvs/love_machine/lib/python2.7/site-packages/simplejson/init.py", line 505, in loads
return _default_decoder.decode(s)
File "/Users/mosesmccall/.virtualenvs/love_machine/lib/python2.7/site-packages/simplejson/decoder.py", line 370, in decode
obj, end = self.raw_decode(s)
File "/Users/mosesmccall/.virtualenvs/love_machine/lib/python2.7/site-packages/simplejson/decoder.py", line 400, in raw_decode
return self.scan_once(s, idx=_w(s, idx).end())
simplejson.scanner.JSONDecodeError: Expecting value: line 3 column 1 (char 3)
Hi Ivan, Do you have any clue why the library is not work? Thanks, Moses |
it has something to do with your account. doesn't happen on any of my accounts. Are you sure you've gone through all the confirmation steps? |
It's unusual issue. I'm don't understand. I searched the settings and couldn't find any issues. Anyway, I created another account now everything works fine. |
huh that is bizarre. Not sure why that happened. I also checked it myself on my machines and it happened for me as well. |
The only difference I noticed the new account has a different search interface. I'm not sure if that change contributes to the problems with the okcupyd library failing, because I assume the okcupid API remains the same. |
oh that would probably do it. okcupid does not have an api. This library works by sort of parsing the html returned by okcupid |
@mosesmc52 Other people are now reporting this issue. Take a look at #63 . I'm going to look in to this more deeply now. |
Hey @mosesmc52 Just thought I'd let you know that this issue has now been resolved in the new alpha version of okcupyd. |
Hi I'm executing I'm new to using okcupyd. I just executed this script below, but I'm receiving the following response
No handlers could be found for logger "okcupyd.search"
Would you know how I could programmatically configure the logger? Also would you have any insight into the issue.
Thanks,
Moses
The text was updated successfully, but these errors were encountered: