- 博客(9)
- 收藏
- 关注
原创 python爬虫豆瓣TOP250电影信息并写入数据库
import requests import pymysql from loguru import logger from lxml import etree db = pymysql.connect(host='localhost', port=3306, user='root', passwd='1234', db='db', charset='utf8') logger.info("正在连接到数据库") cursor = db.cursor() cursor.execute("DR...
2021-10-04 15:25:47
6983
原创 selenium登录斗鱼tv(切换iframe内嵌页面)
from selenium.webdriver import Chrome import time # 1.下载selenium # 2.将驱动放在python解释器文件夹中 web = Chrome() web.get("https://www.douyu.com/") time.sleep(2) web.find_element_by_xpath('//*[@id="js-header"]/div/div/div[3]/div[8]').click() time.sleep(2) # 切换到..
2021-10-03 14:30:45
2155
原创 python爬虫堆糖图片 异步加载
import os import jsonpath import requests headers = { 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4577.82 Safari/537.36', 'Accept': 'text/html,application/xhtml+xml,application/xml;q.
2021-09-28 18:37:50
525
原创 使用xpath批量爬取堆糖图片
import requests from lxml import etree kw = input("输入搜索的关键字:") url = "https://www.duitang.com/search/?kw={}&type=feed".format(kw) headers = { 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/9.
2021-09-27 17:29:04
533
原创 500彩票 足彩赛事(正则表达式)
import requests import re url = 'https://live.500.com/' browser_headers = { 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36' } html = requests.get(url, headers=browser.
2021-09-13 18:44:32
868
原创 猫眼电影(python+re正则)
import re import requests url = 'https://maoyan.com/films' headers = { 'Content-Type': 'text/plain; charset=UTF-8', 'Origin': 'https://maoyan.com', 'Referer': 'https://maoyan.com/board/4', 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win6.
2021-09-13 17:36:02
464
原创 sql查询语句练习
mysql> select * from emp; +-------+--------+-----------+------+------------+------+------+--------+ | empno | ename | job | mgr | hiredate | sal | comm | deptno | +-------+--------+-----------+------+------------+------+------+--------+ | 7.
2021-08-10 21:03:22
196
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅
1