频道栏目
首页 > 资讯 > Python > 正文

说一说关于Pythonrequests

18-07-27        来源:[db:作者]  
收藏   我要投稿
import requests

from bs4 import BeautifulSoup

response = requests.get("https://www.autohome.com.cn/news/")
#print(response.content)
response.encoding = "gbk"
print(response.text)
import requests

from bs4 import BeautifulSoup

response = requests.get("https://www.autohome.com.cn/news/")
#print(response.content)
response.encoding = "gbk"
#print(response.text)

soup = BeautifulSoup(response.text, 'html.parser')
#print(soup)

tag = soup.find(id="auto-channel-lazyload-article").find_all(name="li")

for i in tag:
    print(i.find(name="h3"))
    print("=" * 100)
相关TAG标签
上一篇:关于elasticsearchJavaHighLevelREST的封装操作
下一篇:为什么要离开建筑设计行业转行设计师肺腑之言。
相关文章
图文推荐

关于我们 | 联系我们 | 广告服务 | 投资合作 | 版权申明 | 在线帮助 | 网站地图 | 作品发布 | Vip技术培训 | 举报中心

版权所有: 红黑联盟--致力于做实用的IT技术学习网站