Skip to content Skip to sidebar Skip to footer

Get Renderd Javascript Lines From Website In Python

I'm using python 3.6.6 for this. I'm trying to get the current versionnumber of pycharm from the pycharm website (https://www.jetbrains.com/pycharm/download/#section=windows). The

Solution 1:

update:

I found an solution my self. It seems like render() is in need for sleep. Also I used xpath instead of search.

from requests_html import HTMLSession

session = HTMLSession()
r = session.get('https://www.jetbrains.com/pycharm/download/#section=windows')


r.html.render(sleep=0.1)
item = r.html.xpath('/html/body/div[1]/div[2]/div/div[2]/div[1]/div[2]/ul[1]/li[1]/span/text()')

print('------------------------------------------------')
print(item)

my Result:

['2018.1.4']

Post a Comment for "Get Renderd Javascript Lines From Website In Python"