摘要: from openpyxl import Workbook from openpyxl import load_workbook wb= load_workbook(u"projects-shanghai.xlsx") ws = wb.worksheets[0] maxRow = ws.max_ro 阅读全文
posted @ 2023-06-15 16:46 *飞飞* 阅读(12) 评论(0) 推荐(0)
摘要: Agents = [' (iPhone; U; CPU iPhone OS 4_1 like Mac OS X; en-us) AppleWebKit/532.9 (KHTML, like Gecko) Version/4.0.5 Mobile/8B5097d', ' (Windows NT 5.1 阅读全文
posted @ 2023-06-15 16:39 *飞飞* 阅读(103) 评论(0) 推荐(0)
摘要: 问题:页面F12可以定位元素,但把网页下载到本地,无法定位 2种原因: 1、内容在一个标签中,放在json字符串里 # 内容在input里 inputInfo = soup.find_all('input')[3]['value'] #页面所有内容 xmInfo = json.loads(input 阅读全文
posted @ 2023-06-15 16:23 *飞飞* 阅读(128) 评论(0) 推荐(0)
摘要: 0、初始化: from bs4 import BeautifulSoup pageSource = driver.page_source soup = BeautifulSoup(pageSource,'html.parser') 1、标签名定位 方法1: soup.body 方法2: li.sel 阅读全文
posted @ 2023-06-15 16:12 *飞飞* 阅读(523) 评论(0) 推荐(0)