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

Could be a race condition where the find element is executing before it is present on the page. Take a look at the wait timeout documentation. #5

Open
vaibhavpacharya opened this issue Jul 5, 2020 · 0 comments

Comments

@vaibhavpacharya
Copy link

I am able to run the code locally successfully but getting this error in terminal after initial search in the browser.

 browsermod.cheatyoutubeff(query_word,s_url,max_n,x+1,min_rand,max_rand)
  File "/Users/vaibhavacharya/Desktop/Web Development/YouTube-View-increaser/support/ffyoumod.py", line 49, in cheatyoutubeff
    browser.find_element_by_xpath("//a[contains(@href,'&page="+str(x+2)+"')]"))
  File "//anaconda2/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 394, in find_element_by_xpath
    return self.find_element(by=By.XPATH, value=xpath)
  File "//anaconda2/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 978, in find_element
    'value': value})['value']
  File "//anaconda2/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute
    self.error_handler.check_response(response)
  File "//anaconda2/lib/python2.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":"//a[contains(@href,'&page=2')]"}
  (Session info: chrome=83.0.4103.116)

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

1 participant