Skip to content
Advertisement

Python: How to get HTML text that has Jinja templates using requests or aiohttp?

I am using python, request or aiohttp method to get page, and BeautifulSoup4 for parsing webpage. Server HTML page uses jinja template, so when i get this page using requests or aiohttp, i get something like this:

JavaScript

but if you open this page using browser, code looks like this:

JavaScript

request code:

JavaScript

aiohttp code:

JavaScript

How should i do to get correct page text?

Advertisement

Answer

Used selenium and phantomjs, and now it works.

JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement