当前位置:网站首页>Requests crawl page source code data
Requests crawl page source code data
2022-07-24 07:30:00 【Can't fail I】
requests
- This is a web request based module in crawler
- effect : Simulate the browser to initiate a request .
- Coding process :
- 1. Appoint url
- 2. Initiate request
- 3. Get response data ( Crawled page source code data )
- 4. Persistent storage
1 Crawl the page source code data of Sogou homepage
import requests
# Appoint url
url = 'https://www.sogou.com/'
# Initiate request get The return value of the method is the corresponding object
response = requests.get(url=url)
# Obtain corresponding data
# .text: What is returned is the response data of string type
page_text = response.text
# Persistent storage
with open('./sougou.html', 'w', encoding='utf-8') as fp:
fp.write(page_text)
The effect after running
Follow the column for more details
边栏推荐
- DOM operation of JS -- style operation
- CSDN, it's time to say goodbye!
- Using depth and normal textures in unity
- 【信息系统项目管理师】第七章 复盘成本管理知识架构
- AMD64(x86_64)架构abi文档:上
- The goal you specified requires a project to execute but there is no POM in this directory
- requests-爬虫多页爬取肯德基餐厅位置
- Jenkins 详细部署
- Jackson parsing JSON detailed tutorial
- SPI - send 16 bit and 8-bit data
猜你喜欢

Bookkeeping app: xiaoha bookkeeping 2 - production of registration page

Unity中使用深度和法线纹理

Using depth and normal textures in unity

cookie_ session

QoS quality of service 4 traffic regulation of QoS boundary behavior

拉普拉斯(Laplace)分布

Oauth2==sso three protocols. Oauth2 four modes

Learning strategies of 2D target detection overview (final chapter)

【LeetCode-简单】20. 有效的括号 - 栈

Blockbuster live broadcast | orb-slam3 series code explanation map points (topic 2)
随机推荐
QoS quality of service 4 traffic regulation of QoS boundary behavior
Riotboard development board series notes (IX) -- buildreoot porting matchbox
Decompress the anchor and enjoy 4000w+ playback, adding a new wind to the Kwai food track?
requests-爬虫实现一个简易网页采集器
Harbor2.2 用户角色权限速查
Part II - C language improvement_ 3. Pointer reinforcement
系统集成项目管理工程师(软考中级)重点知识、背诵版
Stm32h750vbt6 drives programmable gain amplifier module pga113 -- Hal Library Based on cubemx
从CIA看常见网络攻击(爆破,PE,流量攻击)
Simple installation of sqli Labs
Injectfix principle learning (to realize the heat of repair addition)
Single Gmv has increased 100 times. What is the "general rule" behind the rise of popular brands?
归纳、概括、演绎
单场GMV翻了100倍,冷门品牌崛起背后的“通用法则”是什么?
mysql查询当前节点的所有父级
项目中数据库插入大批量数据遇到的问题
Using depth and normal textures in unity
Chinese manufacturers may catch up with the humanoid robot Optimus "Optimus Prime", which has been highly hyped by musk
24.全局事件总线
Network security B module windows operating system penetration test of national vocational college skills competition
