Python:Webscraping-link不是用html打印的

时间:2018-06-17 13:58:36

标签: python web-scraping beautifulsoup urllib

我正在尝试从以下网站https://www.rexchange.com中提取“href =”/ sell-with-rex“。该值嵌入在以下位置:

<a id="lnkSellingWithREX" href="/sell-with-rex" class="navbar-brand" analytics-on="" analytics-event="click" analytics-category="nav-selling-with-rex" analytics-label="nav-selling-with-rex">Sell with REX</a>

我正在使用以下代码打印html

from urllib.request import urlopen
from bs4 import BeautifulSoup

url ='https://www.rexchange.com/'

response = urlopen(url)
html_soup = BeautifulSoup(response,'lxml')
#print((html_soup.prettify()))

当我打印html时,我没有看到值“href =”/ sell-with-rex“。当我右键单击它并检查链接时,我才能看到它。

如果没有在html中打印,我怎么能提取这些数据?

0 个答案:

没有答案