查淘宝账号的软件(一键查旺旺号)

1、导入需要的包
import timefrom bs4
import BeautifulSoupfrom selenium
import webdriver
2、编辑淘宝数据抓取的函数逻辑
# 编辑淘宝数据抓取的函数逻辑
“””
1.登录淘宝
2.首页
3.指定商品的搜索信息
4.提取指定商品的金额、购买人数、商铺地址、商品名称、商品图片
“””
3、打开淘宝网页,并扫码登陆点击淘宝网首页
def login_info(self):
# 1.打开网页
self.browser.get(self.url)
# 2.通过扫码的形式去登录淘宝账号
if self.browser.find_element_by_xpath(‘//*[@id=”login”]/div[1]/i’):
self.browser.find_element_by_xpath(‘//*[@id=”login”]/div[1]/i’).click()
# 让程序等待休眠5秒,通过手机扫码登录
time.sleep(8)
# 3.点击淘宝网首页
taobao_index = self.browser.find_element_by_xpath(‘//*[@id=”J_SiteNavHome”]/div/a’)
taobao_index.click()
time.sleep(1)
4、自动地在淘宝首页中输入自己想要搜索的商品名称,并且自动点击搜索
search_input = self.browser.find_element_by_xpath(‘//*[@id=”q”]’)
shop_name = input(“请输入你想搜索的商品名称:”)
search_input.send_keys(shop_name)
time.sleep(0.5)
search_submit = self.browser.find_element_by_xpath(‘//*[@id=”J_TSearchForm”]/div[1]/button’)
search_submit.click()
5、获取商品信息
# 商品金额
shop_price_data = shop_data.find_all(‘div’, class_=’price g_price g_price-highlight’)
for shop_price in shop_price_data:
shop_price_list.append(shop_price.text.strip())
# 购买人数
shop_people_number_data = shop_data.find_all(‘div’,’deal-cnt’)
for shop_people_number in shop_people_number_data:
shop_people_list.append(shop_people_number.text)
# 店铺地区
shop_location_data = shop_data.find_all(‘div’,’location’)
for shop_location in shop_location_data:
shop_location_list.append(shop_location.text)
代理IP质量稳定,我们才能够更好更快地去执行工作任务,例如神龙,多平台适用,遍布全国的自营服务器节点,可以更好的辅助爬虫。