CraigLister icon indicating copy to clipboard operation
CraigLister copied to clipboard

Selenium New Py user and I'm not sure what went wrong.

Open rndichu opened this issue 8 years ago • 7 comments

Microsoft Windows [Version 10.0.14393]

C:\Users\Richard\Documents\Testsite\CraigLister\gmail>python craiglister.py
listingFolder C:\Users\Richard\Documents\Testsite\CraigLister\gmail\listings\xxxxxxxxx
listingImages ['2017-01-03-PHOTO-00004803.jpg', '2017-01-03-PHOTO-00004804.jpg', '2017-01-03-PHOTO-00004805.jpg', '2017-01-03-PHOTO-00004806.jpg', '2017-01-03-PHOTO-00004808.jpg', '2017-01-03-PHOTO-00004809.jpg', '2017-01-03-PHOTO-00004810.jpg', '2017-01-03-PHOTO-00004811.jpg', '2017-01-03-PHOTO-00004812.jpg', '2017-01-03-PHOTO-00004813.jpg', '2017-01-03-PHOTO-00004814.jpg', '2017-01-03-PHOTO-00004815.jpg', '2017-01-03-PHOTO-00004816.jpg', '2017-01-03-PHOTO-00004817.jpg', '2017-01-03-PHOTO-00004818.jpg', '2017-01-03-PHOTO-00004819.jpg', '2017-01-03-PHOTO-00004820.jpg', '2017-01-03-PHOTO-00004821.jpg', '2017-01-03-PHOTO-00004822.jpg', 'Thumbs.db']
Traceback (most recent call last):
  File "craiglister.py", line 241, in <module>
    postListing(listing)
  File "craiglister.py", line 120, in postListing
    clickListingType(listing)
  File "craiglister.py", line 65, in clickListingType
    listing.driver.find_element_by_xpath("//*[@id='pagecontainer']/section/form/blockquote//label[contains(.,'" + listing.type + "')]/input").click()
  File "C:\Python27\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 293, in find_element_by_xpath
    return self.find_element(by=By.XPATH, value=xpath)
  File "C:\Python27\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 752, in find_element
    'value': value})['value']
  File "C:\Python27\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 236, in execute
    self.error_handler.check_response(response)
  **File "C:\Python27\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 192, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"xpath","selector":"//*[@id='pagecontainer']/section/form/blockquote//label[contains(.,'service offered')]/input"}
  (Session info: chrome=56.0.2924.87)
  (Driver info: chromedriver=2.27.440174 (e97a722caafc2d3a8b807ee115bfb307f7d2cfd9),platform=Windows NT 10.0.14393 x86_64)**

looks like craigslist may have shaked things up or selenium isnt able to identify elements properly. My laptop sucks and wifi is slow so ill keep checking if its just me.

rndichu avatar Feb 18 '17 03:02 rndichu

Looks like Selenium couldn't find the element. Perhaps Craigslist website has changed or your city has a different workflow than the city this was developed for.

Nicholas Smith Software Engineer In Test

www.clickthisnick.com http://clickthisnick.com/

On Fri, Feb 17, 2017 at 10:15 PM, rndichu [email protected] wrote:

Microsoft Windows [Version 10.0.14393]

C:\Users\Richard\Documents\Testsite\CraigLister\gmail>python craiglister.py listingFolder C:\Users\Richard\Documents\Testsite\CraigLister\gmail\listings\xxxxxxxxx listingImages ['2017-01-03-PHOTO-00004803.jpg', '2017-01-03-PHOTO-00004804.jpg', '2017-01-03-PHOTO-00004805.jpg', '2017-01-03-PHOTO-00004806.jpg', '2017-01-03-PHOTO-00004808.jpg', '2017-01-03-PHOTO-00004809.jpg', '2017-01-03-PHOTO-00004810.jpg', '2017-01-03-PHOTO-00004811.jpg', '2017-01-03-PHOTO-00004812.jpg', '2017-01-03-PHOTO-00004813.jpg', '2017-01-03-PHOTO-00004814.jpg', '2017-01-03-PHOTO-00004815.jpg', '2017-01-03-PHOTO-00004816.jpg', '2017-01-03-PHOTO-00004817.jpg', '2017-01-03-PHOTO-00004818.jpg', '2017-01-03-PHOTO-00004819.jpg', '2017-01-03-PHOTO-00004820.jpg', '2017-01-03-PHOTO-00004821.jpg', '2017-01-03-PHOTO-00004822.jpg', 'Thumbs.db'] Traceback (most recent call last): File "craiglister.py", line 241, in postListing(listing) File "craiglister.py", line 120, in postListing clickListingType(listing) File "craiglister.py", line 65, in clickListingType listing.driver.find_element_by_xpath("//[@id='pagecontainer']/section/form/blockquote//label[contains(.,'" + listing.type + "')]/input").click() File "C:\Python27\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 293, in find_element_by_xpath return self.find_element(by=By.XPATH, value=xpath) File "C:\Python27\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 752, in find_element 'value': value})['value'] File "C:\Python27\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 236, in execute self.error_handler.check_response(response) **File "C:\Python27\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 192, in check_response raise exception_class(message, screen, stacktrace) selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"xpath","selector":"//[@id='pagecontainer']/section/form/blockquote//label[contains(.,'service offered')]/input"} (Session info: chrome=56.0.2924.87) (Driver info: chromedriver=2.27.440174 (e97a722caafc2d3a8b807ee115bfb307f7d2cfd9),platform=Windows NT 10.0.14393 x86_64)**

looks like craigslist may have shaked things up or selenium isnt able to identify elements properly. My laptop sucks and wifi is slow so ill keep checking if its just me.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/clickthisnick/CraigLister/issues/7, or mute the thread https://github.com/notifications/unsubscribe-auth/AHfcVVpLjM6WNcarUaN5BjLdzkKMvIttks5rdmJbgaJpZM4ME-Kd .

clickthisnick avatar Feb 19 '17 23:02 clickthisnick

@rndichu Did you solve this? I am having the same issue.

exobin avatar Apr 01 '17 21:04 exobin

nope. i trying to rewrite it drunk from the ground up. harder than i thought.

rndichu avatar Apr 01 '17 23:04 rndichu

I've implemented a super specific fix for my use case. I can send to you if you'd like :)

On Apr 1, 2017, at 4:59 PM, rndichu [email protected] wrote:

nope. i trying to rewrite it drunk from the ground up. harder than i thought.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

exobin avatar Apr 02 '17 01:04 exobin

That would be great

On Apr 1, 2017 8:48 PM, "Alexi Robbins" [email protected] wrote:

I've implemented a super specific fix for my use case. I can send to you if you'd like :)

On Apr 1, 2017, at 4:59 PM, rndichu [email protected] wrote:

nope. i trying to rewrite it drunk from the ground up. harder than i thought.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/clickthisnick/CraigLister/issues/7#issuecomment-290958982, or mute the thread https://github.com/notifications/unsubscribe-auth/AVfdv-Oy_PzGh9_NhkmDMbe6Ha9cjzENks5rrv5lgaJpZM4ME-Kd .

rndichu avatar Apr 02 '17 10:04 rndichu

craiglister.py.zip

Hope that helps!

exobin avatar Apr 02 '17 23:04 exobin

listingImages ['1.jpg', '2.jpeg', '3.jpg', '4.jpg', '5.jpg', '6.jpg', '7.jpg'] Traceback (most recent call last): File "craiglister-old.py", line 241, in postListing(listing) File "craiglister-old.py", line 120, in postListing clickListingType(listing) File "craiglister-old.py", line 65, in clickListingType listing.driver.find_element_by_xpath("//[@id='pagecontainer']/section/form/blockquote//label[contains(.,'" + listing.type + "')]/input").click() File "/Library/Python/2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 385, in find_element_by_xpath return self.find_element(by=By.XPATH, value=xpath) File "/Library/Python/2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 955, in find_element 'value': value})['value'] File "/Library/Python/2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 312, in execute self.error_handler.check_response(response) File "/Library/Python/2.7/site-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response raise exception_class(message, screen, stacktrace) selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"xpath","selector":"//[@id='pagecontainer']/section/form/blockquote//label[contains(.,'for sale by owner')]/input"} (Session info: chrome=65.0.3325.181) (Driver info: chromedriver=2.37.544337 (8c0344a12e552148c185f7d5117db1f28d6c9e85),platform=Mac OS X 10.13.4 x86_64)

I saw you guys had the same problem, someone fixed this problem ? new using selenium and python I can't find where is the problem.

brunopicanco avatar Apr 08 '18 03:04 brunopicanco