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