selenium 爬去淘宝数据被引导到登陆页面,怎么处理相关代码def search():try:
browser.get('https://www.taobao.com') input = wait.until(EC.presence_of_element_located((By.CSS_SELECTOR, '#q')))
submit = wait.until(
EC.element_to_be_clickable((By.CSS_SELECTOR, '#J_TSearchForm > div.search-button > button'))) input.send_keys('女装') time.sleep(10)
submit.click()
total = wait.until(EC.presence_of_element_located(
(By.CSS_SELECTOR, '#mainsrp-pager > div > div > div > div.total'))) return total.text
except TimeoutError: return search()能告诉我什么原因吗?
添加回答
举报
0/150
提交
取消