如何使用requests_html获取网站信息?

时间:2019-03-08 06:55:22

标签: python python-requests

我要访问的网址是https://dealer.autohome.com.cn/2065423/

我写的代码是:

from requests_html import HTMLSession
url = r'https://dealer.autohome.com.cn/2065423/'
session = HTMLSession()
r = session.get(url)
r.html.render()
soup = BeautifulSoup(r.text, 'lxml')
data = soup.findAll('div', {'class':'allagency-cont'})

allagency-cont标记中,我想要但错过的信息是:

<div class="telphone">
<div title="当前商家咨询电话数量接通服务比例">
    电话接听率:100%
</div>
<div class="fn-clear">
    <div class="phone-name">
        15天订单量:
    </div>
    <div title="当前商家15天内订单量数量" class="progress">
        <span style="width:20%;" class="progress-value"></span>
    </div>
</div>

JavaScript尚未执行。我该怎么办?

谢谢

0 个答案:

没有答案