WebDriver
ž硒4.6是诱人的·安静·奇数ªo±±±和¼ää电ɪ电ɪäääääääääää谢ºäälºä妖ºº妖ºº狮钟ºººº知妖妖才妖才飞
>>> from selenium import webdriver
>>> driver = webdriver.Firefox()
Å了ªª奥网络驱动器äm。 p>
äässiiummanageræ� »firaval的»°¶
婴儿是ªªÅ和|±.t®âtriver·web driver·或未ÅÅVA,€,ä½和| stock·和€¾,ét和e |和ç和ç和ç和ç和ç和çis |½Å了,|½。 Žä½ooqiqo9
pip install webdriver-manager
Å®è£ÅÅ了€ä面
>>> from selenium import webdriver
>>> from webdriver_manager.microsoft import EdgeChromiumDriverManager
>>> from selenium.webdriver.edge.service import Service
>>> driver = webdriver.Edge(
... service=Service(EdgeChromiumDriverManager().install()))
ÉÅ¥¥¥ä面,
>>> from selenium import webdriver
>>> from webdriver_manager.firefox import GeckoDriverManager
>>> driver = webdriver.Firefox(executable_path=GeckoD
... riverManager().install())
Å。提供Å的Chrome£char½D:\ Apps \ portient Rich \ Chrome。是ä¥飞集
>>> from selenium.webdriver.chrome.options import Options
>>> o = Options()
>>> o.binary_location = "d:\\apps\\PortableApps\\GoogleChromePortable\\App\\Chrome-bin\\chrome.exe"
>>> driver = webdriver.Chrome(options=o)
žÅÅ
selenium4äβFint。
àèää»»»»»»»»°13°13。
>>> driver.get("https://www.w3schools.com/html/html_tables.asp")
Ŷä电¶¼IDC.“客户”,è¥è “¼,Å以ɣ£ÅPHAM
>>> from selenium.webdriver.common.by import By
>>> td = driver.find_element(By.CSS_SELECTOR, "#customers td")
>>> td.text
'Alfreds Futterkiste'
ƾ¾¾¾ų¾¾VOAPHIM¾¾¾¾W'__W'_w'__ ical。 æ -æ实ż
>>> tab = driver.find_element(By.ID, "customers")
>>> tds = tab.find_elements(By.TAG_NAME, "td")
>>> len(tds)
18
>>> tds[0].text
'Alfreds Futterkiste'