[問題] 爬蟲問題
小弟爬蟲新手
目前正在爬字典(已成功用網頁API爬出意思)
假如我想爬apple(不使用API)
從page source裡知道意思在下面程式碼的content裡
<meta name="twitter:description" content=" "/>
我要如何用findall 或是 find 找到這句
然後print出content的" "裡的意思?
自己寫的程式碼
from urllib.request import urlopen
from bs4 import BeautifulSoup
def DictRequest(word):
html = urlopen("https://www.merriam-webster.com/dictionary/"+ word)
bsobj = BeautifulSoup(html.read(), 'html')
meaning = bsobj.findAll('meta', name = 'twitter:description')
TypeError: find_all() got multiple values for argument 'name'
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 73.223.41.252
※ 文章網址: https://www.ptt.cc/bbs/Python/M.1531793524.A.411.html
→
07/17 10:17,
7年前
, 1F
07/17 10:17, 1F
→
07/17 10:28,
7年前
, 2F
07/17 10:28, 2F
→
07/17 10:35,
7年前
, 3F
07/17 10:35, 3F
→
07/17 10:36,
7年前
, 4F
07/17 10:36, 4F
→
07/17 10:36,
7年前
, 5F
07/17 10:36, 5F
→
07/17 10:55,
7年前
, 6F
07/17 10:55, 6F
推
07/17 10:57,
7年前
, 7F
07/17 10:57, 7F
→
07/17 11:00,
7年前
, 8F
07/17 11:00, 8F
討論串 (同標題文章)
Python 近期熱門文章
PTT數位生活區 即時熱門文章