Python 评论在网页上可见,但BeautifulSoup返回的html对象不包含评论部分

Python 评论在网页上可见,但BeautifulSoup返回的html对象不包含评论部分,python,web-scraping,beautifulsoup,data-extraction,Python,Web Scraping,Beautifulsoup,Data Extraction,我试图使用网页的URL链接从网页中提取评论的文本内容,并使用BeautifulSoup进行抓取。当我单击URL链接时,评论的内容在页面上是可见的,但是BeautifulSoup返回的HTML对象不包含这些标记和文本 我使用BeautifulSoup和'html.parser'来进行web抓取。我成功地提取了给定网页中视频的喜欢/浏览/评论数量,但HTML文件中未包含评论部分的信息。我使用的浏览器是Chrome,系统是Ubuntu18.04.1LTS 这是我(在python中)使用的代码: 预期的

我试图使用网页的URL链接从网页中提取评论的文本内容,并使用BeautifulSoup进行抓取。当我单击URL链接时,评论的内容在页面上是可见的,但是BeautifulSoup返回的HTML对象不包含这些标记和文本

我使用BeautifulSoup和'html.parser'来进行web抓取。我成功地提取了给定网页中视频的喜欢/浏览/评论数量,但HTML文件中未包含评论部分的信息。我使用的浏览器是Chrome,系统是Ubuntu18.04.1LTS

这是我(在python中)使用的代码:

预期的结果是,soup对象包含网页上可见的所有内容,尤其是评论的文本内容(如“不在那里,我非常喜欢看到白熊的生活方式。感谢提供商提供此类纪录片。”和“哇……太棒了……”);但是,我在soup对象中找不到相应的节点。
任何帮助都将不胜感激

注释由JavasSript通过ajax请求生成。您可以发送相同的请求并从
json
响应中获取注释。您可以使用inspect工具中的network(网络)选项卡查找请求

from urllib.request import urlopen
from bs4 import BeautifulSoup, Comment
import json
webpage_link = "https://www.airvuz.com/api/comments/video/59b2a56141ab4823e61ea901?page=1&limit=20"
page = urlopen(webpage_link).read()
comments_json=data = json.loads(page)
for comment_info in comments_json['data']:
    print(comment_info['comment'].strip()) 
输出

Not being there I enjoyed a lot seeing the life style of white bear. Thanks to the provider for  such documentary.
WOOOW... amazing...
I've been photographing polar bears for years, but to see this footage from a drones perspective was epic! Well done and congratz on the Nominee! Well deserved.
You are da man Florian!
Absolutely outstanding!
This is incredible
jaw dropping
This is wow amazing, love it.
So cool! Did the bears react to the drone at all?
Congratulations! It's awesome! I am watching in tears....
Awesome!
perfect video awesome
It is very, very beautiful !!! Sincere congratulations
Made my day, exquisite, thank you
Wow
Super!
Marvelous!
Man this is incredible!
Material is good, but  edi is bad. This history about  beer's family...
Muy bueno!

注释由JavasSript通过ajax请求生成。您可以发送相同的请求并从
json
响应中获取注释。您可以使用inspect工具中的network(网络)选项卡查找请求

from urllib.request import urlopen
from bs4 import BeautifulSoup, Comment
import json
webpage_link = "https://www.airvuz.com/api/comments/video/59b2a56141ab4823e61ea901?page=1&limit=20"
page = urlopen(webpage_link).read()
comments_json=data = json.loads(page)
for comment_info in comments_json['data']:
    print(comment_info['comment'].strip()) 
输出

Not being there I enjoyed a lot seeing the life style of white bear. Thanks to the provider for  such documentary.
WOOOW... amazing...
I've been photographing polar bears for years, but to see this footage from a drones perspective was epic! Well done and congratz on the Nominee! Well deserved.
You are da man Florian!
Absolutely outstanding!
This is incredible
jaw dropping
This is wow amazing, love it.
So cool! Did the bears react to the drone at all?
Congratulations! It's awesome! I am watching in tears....
Awesome!
perfect video awesome
It is very, very beautiful !!! Sincere congratulations
Made my day, exquisite, thank you
Wow
Super!
Marvelous!
Man this is incredible!
Material is good, but  edi is bad. This history about  beer's family...
Muy bueno!

我试过这里的解决方案帖子:,但也不起作用。我试过这里的解决方案帖子:,但也不起作用。比你!你是如何得到网页链接的价值的?比你!你是如何获得网页链接的价值的?