Problem: selenium.common.exceptions.WebDriverException:Message: ' chromedriver ' executable needs to being in PATH. Please see Https://sites.google.com/a/chromium.org/chromedriver/home
Cause: The hint was not added to the PATH environment variable and Webdriver was not found
Solution: Win10 used to add Chromedriver directory to the PATH environment variable, but still reported the same error, after searching, found to put Chromedriver.exe in the same directory as the Python script can run successfully!
Issue: TypeError: ' Webelement ' object is not iterable
Cause: When selecting multiple HTML page elements, you should use the plural of the method
Resolution: Use Find_elements_by_tag_name, here element has s
Issue: Attributeerror: ' Webelement ' object has no attribute ' SendKeys '
Reason: The code is written in SendKeys, but there is no such method (actually Send_keys)
Solution: Change SendKeys to Send_keys (this problem is purely careless = =)
Background: In the use of selenium crawler, you need to enter the keyword search, but there is the opening of the Web page, enter the keyword after the exception is thrown.
Problem: After opening the Web page, throw an exception, then the browser automatically closes
Reason: Debugging found the location of the exception thrown in:
Webdriverwait (driver,15). Until (
Ec.title_contains (Unicode (to_city))
)
This means waiting for the search results page to load the page containing the keyword before proceeding to the next step, but because the previous step entered the To_city value unexpectedly points to the other city name, causing this step to throw an exception cannot continue
"Selenium+python" a few questions about using Selenium 1