0
我试图使用python和selen来搜索google搜索结果。我只能得到第一个搜索结果。这是我正在使用的代码。使用python从源代码中抓取文本
driver.get(url)
res = driver.find_elements_by_css_selector('div.g')
link = res[0].find_element_by_tag_name("a")
href = link.get_attribute("href")
如何获取所有搜索结果?
您试图获得多个结果? – JeffC
我使用了Andersson提出的解决方案。 – Joe