Minggu, 20 Maret 2022

Chromium Selenium ChromeDriver

 

Download ChromeDriver terbaru (Versi 99 atau 100)
https://chromedriver.chromium.org/
Atau:
https://chromedriver.storage.googleapis.com/index.html?path=100.0.4896.20/
https://chromedriver.storage.googleapis.com/index.html?path=99.0.4844.51/

ATau u versi JAdul::
https://sites.google.com/a/chromium.org/chromedriver/downloads

from selenium import webdriver
from selenium.webdriver.chrome.options import Options
import chromedriver_binary  

def server_start(self):
#https://chromedriver.chromium.org/home
pathq="C://Program Files (x86)//Google//Chrome//Application//chrome.exe"
pathd="C://Program Files (x86)//Google//Chrome//Application//chromedriver.exe"
print("OKS ME")
#browser = webdriver.Chrome(executable_path=r"C://Program Files (x86)//Google//Chrome//Application//chrome.exe")
#browser = webdriver.Chrome(executable_path=r"C:\path\to\chromedriver.exe")
#self.browser = webdriver.Chrome(executable_path=r"lib\\chromedriver.exe")
#browser = webdriver.Chrome()
#browser = webdriver.Chrome()
#browser.get("http://www.lp2maray.org")

options = Options()
options.binary_location = pathq
self.browser = webdriver.Chrome(chrome_options=options, executable_path=pathd, )

self.browser.get("https://accounts.google.com/signin/v2/identifier?flowName=GlifWebSignIn&flowEntry=ServiceLogin")
return self.browser



atau intinya begini:

driver = webdriver.Chrome('C:\Users\name\Downloads\chromedriver_win32\chromedriver.exe')
driver.implicitly_wait(30) # seconds
driver.get('https://www.google.co.in/')

==============

Jika muncul error:

https://accounts.google.com/signin/v2/identifier?flowName=GlifWebSignIn&flowEntry=ServiceLogin&hl=in

https://accounts.google.com/signin/v2/recoveryidentifier?flowName=GlifWebSignIn&flowEntry=ServiceLogin





Error pada xrange
xrange u python 2

so jika memakai python 3 gunakan 
xrange=range

ATAU
from
past.builtins import xrange