使用教程
- 下载chrome浏览器
- 查看chrome浏览器的版本号,对应版本号的chromedriver驱动
- pip安装下列包
- pip install selenium
- 登录微博,并通过微博绑定淘宝账号密码
- 在chromedriver_path中填写chromedriver的绝对路径
- 事先填写好自己的微博账号密码
chromedriver驱动下载方式参考:https://blog.csdn.net/muriyue6/article/details/101440353
通过微博绑定淘宝账号代码参考文档链接:https://blog.csdn.net/qq_45327272/article/details/99053395
视频教学(爬取数据部分)参考链接:https://www.bilibili.com/video/BV1qJ411y71J?p=9
import csv
import json
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from pyquery import PyQuery as pq
import re
chromedriver_path = "C:/Users/mqm/Desktop/chromedriver.exe" # 改成你的chromedriver
class taobao_infos:
# 对象初始化
def __init__(self):
url = 'https://login.taobao.com/member/login.jhtml'
self.url = url
options = webdriver.ChromeOptions()
options.add_experimental_option('excludeSwit