Beautifoul汤刮旅行顾问partial_entry

时间:2017-06-09 15:09:50

标签: python beautifulsoup screen-scraping

您想创建一个程序来取消Trip顾问评论,但我只有一部分评论。我想添加链接背后的完整评论"更多"

Capture of link

def make_soup(url):
    thepage = urllib.request.urlopen(url)
    soupdata =BeautifulSoup(thepage, "html.parser")
    return soupdata

for i in range(5,200,5):
    soup = make_soup("https://www.tripadvisor.co.uk/Hotel_Review-g187497-d7142609-Reviews-or"+str(i))
    for item in soup.findAll('p', {'class' : 'partial_entry'}) :
        liste_noms.append(item.getText())
        print(item.text)

0 个答案:

没有答案