from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver import Chrome
from selenium.webdriver import ChromeOptions
import time
option = ChromeOptions()
# 此步骤很重要,设置为开发者模式,防止被各大网站识别出来使用了Selenium(百度搜索来的)
option.add_experimental_option('excludeSwitches', ['enable-automation'])
option.add_argument("--disable-blink-features")
option.add_argument("--disable-blink-features=AutomationControlled")
wd = Chrome(options=option)
wd.get('https://uland.taobao.com/sem/tbsearch?refpid=mm_26632258_3504122_32538762&keyword=%E5%A5%B3%E8%A3%85&clk1=ec9383fd548ffeed8bb416edf8b9a39d&upsId=ec9383fd548ffeed8bb416edf8b9a39d')
wd.implicitly_wait(5)
#点击登录
login=wd.find_element(By.CSS_SELECTOR,'#J_LoginInfoHd>a:nth-child(1)').click()
#输入用户名密码
pas
selenium--淘宝打开价格最低的物品
于 2022-04-17 18:23:20 首次发布
这篇博客介绍了如何利用Python的Selenium库在淘宝上自动化搜索并找到价格最低的商品,是Python爬虫实战的一个简单示例。
摘要由CSDN通过智能技术生成