Skip to content
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

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

Open
rndichu opened this issue Feb 18, 2017 · 7 comments
Open

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

rndichu opened this issue Feb 18, 2017 · 7 comments

Comments

@rndichu
Copy link

rndichu commented Feb 18, 2017

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.

@clickthisnick
Copy link
Owner

clickthisnick commented Feb 19, 2017 via email

@exobin
Copy link

exobin commented Apr 1, 2017

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

@rndichu
Copy link
Author

rndichu commented Apr 1, 2017

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

@exobin
Copy link

exobin commented Apr 2, 2017 via email

@rndichu
Copy link
Author

rndichu commented Apr 2, 2017 via email

@exobin
Copy link

exobin commented Apr 2, 2017

craiglister.py.zip

Hope that helps!

@brunopicanco
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants