""" python获取txt中多行网址(每行一个网址)并网页截图v202111302258(原创) chromedriver.exe版本号与chrome.exe版本号(地址栏输入chrome://version/查看版本)相同,放于python.exe同级目录(C:Program Files (x86)Python310-32);下载地址:https://chromedriver.storage.googleapis.com/index.html """ from selenium import webdriver from urllib import request import re import os import datetime print(datetime.datetime.now()) filedir = "d:\tsldrb_pic\" if not os.path.exists(filedir): os.makedirs(filedir) f = open("d:\urls.txt", "r", encoding='utf-8') urls = f.readlines() for url in urls: print(url.replace('n', '')) driver = webdriver.Chrome() driver.maximize_window() driver.get(url) data_content = request.urlopen(url.replace('n', '')) content_text = data_content.read().decode() result_title_time = re.search('(?<=content/).*(?=/content)', url.replace('n', '')) # 匹配content/和/content间时间 result_title = re.search('(?<=">).*(?=和欢迎分享,转载请注明来源:内存溢出
python获取txt中多行网址(每行一个网址)并网页截图v202111302258(原创)
赞
(0)
打赏
微信扫一扫
支付宝扫一扫
pytorch torchvision.datasets
上一篇
2022-12-15
PyQt5报错:Destroyed while thread is still running
下一篇
2022-12-15
评论列表(0条)