Nyoba selenium

This commit is contained in:
yasir 2022-12-11 09:11:41 +07:00
parent 19c9834dff
commit 042de39c48

View file

@ -16,10 +16,11 @@ async def pahe(_, msg):
# chromedriver_autoinstaller.install()
os.chmod("/MissKaty/chromedriver", 755)
chrome_options = webdriver.ChromeOptions()
chrome_options.binary_location = "/usr/bin/google-chrome"
chrome_options.add_argument("--headless")
chrome_options.add_argument("--no-sandbox")
chrome_options.add_argument("--disable-dev-shm-usage")
wd = webdriver.Chrome("/MissKaty/chromedriver", chrome_options=chrome_options)
wd.get("https://pahe.li/")
LOGGER.info(wd.page_source)
driver = webdriver.Chrome(
options=chrome_options, executable_path="/MissKaty/chromedriver"
)
driver.get("https://pahe.li/")
LOGGER.info(driver.page_source)