浏览文章
文章信息
Selenium google驱动下载安装
13125
谷歌驱动下载
https://npm.taobao.org/mirrors/chromedriver?spm=a2c6h.14029880.0.0.735975d7jW7LC2
必须查找对应google浏览器版本,否则驱动不起来或者异常
下载后解压,然后放到项目下
from selenium import webdriver import os from bs4 import BeautifulSoup as bs import time import re from urllib.request import urlopen import json from pandas.io.json import json_normalize import pandas as pd, numpy as np username='aiweline8' password='Qfyf0078' # ----启动浏览器---- #1 查找驱动 browser = webdriver.Chrome(os.getcwd()+'/Drivers/chromedriver_win32/chromedriver.exe') browser.get('https://www.instagram.com/'+username+'/?hl=en') Pagelength = browser.execute_script("window.scrollTo(0, document.body.scrollHeight);")