Use code tags
Do not use
Use my code and not the older stuff that you use,then is like this.
So i have have added this myself to Path
Just copy all of my code and make or use a Path that's in Environment Variables Path.
Or this also work,copy code and remove path:
Here also comment out
Do not use
\
in file path on Windows because of escape character ,see that i use r
r'path'
Use my code and not the older stuff that you use,then is like this.
from selenium.webdriver.chrome.options import Options options = Options() options.add_argument('--headless')
ABVSVL Wrote:selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable needs to be in PATH.This mean that
chromedriver.exe
most be in Environment Variables Path.So i have have added this myself to Path
C:\cmder\bin\chromedriver.exe
.Just copy all of my code and make or use a Path that's in Environment Variables Path.
Or this also work,copy code and remove path:
from selenium import webdriver from selenium.webdriver.chrome.options import Options import time options = Options() #options.add_argument("--headless") #options.add_argument("window-size=1920,1080") browser = webdriver.Chrome(executable_path=r'chromedriver.exe', options=options) browser.get('https://www.tesmanian.com/blogs/tesmanian-blog') browser.save_screenshot("page1.png") time.sleep(5) browser.execute_script("window.scrollTo(0, 800);") browser.save_screenshot("page2.png") time.sleep(5) browser.close()Now have files in same folder,eg make a folder
my_sel
.Here also comment out
--headless
and add som time sleep then it easier to see how window.scrollTo()
work.C:\my_sel\ |-- sel_screenshot.py |-- chromedriver.exe