3
我使用.get_data()方法與機械化,它似乎打印出我想要的HTML。我也檢查它打印出來的類型,類型是'str'。「模塊對象不可調用」是什麼意思?
但是,當我嘗試解析與BeautifulSoup的海峽,我得到以下錯誤:
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-163-11c061bf6c04> in <module>()
7 html = get_html(first[i],last[i])
8 print type(html)
----> 9 print parse_page(html)
10 # l_to_store.append(parse_page(html))
11 # hfb_data['l_to_store']=l_to_store
<ipython-input-161-bedc1ba19b10> in parse_hfb_page(html)
3 parse html to extract info in connection with a particular person
4 '''
----> 5 soup = BeautifulSoup(html)
6 for el in soup.find_all('li'):
7 if el.find('span').contents[0]=='Item:':
TypeError: 'module' object is not callable
究竟什麼是「模塊」,以及如何得到什麼GET_DATA()返回到HTML?
嘗試:'BeautifulSoup.BeautifulSoup(html)' – yonili