猫史档案馆


【Python作品分享】简易爬虫【作业帖】

用户:小黄不是咸鱼小黄不是咸鱼查看:0 回复:1 评论:0 创建时间:2023-10-18T16:59:47


【作品展示】

center_image

 

【作品介绍】

123456789

 

【作品源代码】

import requests
import bs4




a=input()
url = ('https://deer.zuoyebang.com/static/pwc/english.html?word=' + a + '&lang=en')
r = requests.get(url)
soup = bs4.BeautifulSoup(r.content, 'html.parser')
data = soup.find_all('span', class_='content')
info = data[0].text
print(info)

 

【提示】

部分含有Python第三方库相关内容的作品,在海龟编辑器网页端无法运行哦!如遇到这种情况,可以打开下面的链接,下载海龟编辑器客户端:

https://python.codemao.cn


回复

上一页1 页 / 共 1下一页
小黄不是咸鱼小黄不是咸鱼

imgsrc="https://static.cod喵/emoji/codemao/%E7%BC%96%E7%A8%8B%E7%8C%AB_%E5%86%B7%E6%BC%A0.gif"alt="emotion_编程猫_冷漠"

点赞0


评论