selenium--淘宝打开价格最低的物品

这篇博客介绍了如何利用Python的Selenium库在淘宝上自动化搜索并找到价格最低的商品,是Python爬虫实战的一个简单示例。
摘要由CSDN通过智能技术生成
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
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值