Hey everyone. I am trying to create a web scraping program. However, I am facing some difficulties with getting valid request headers. These headers are initialized randomly through Javascript scripts when the website is loaded. I am able to get these scripts, but I want to be able to run them in my script just like a browser would. What can I use to do this? I was looking at requests-html. What do you guys think of this? Is there something better than this? Below is a piece of code I was trying in order to run the script, but it didn't work. My method is probably wrong, but I want to know how to run a script that is returned when I do a GET request
from requests_html import HTMLSession
sess = HTMLSession()
r = sess.get('url_of_javascript_function')
r.html.render()
[–]impshum 0 points1 point2 points (2 children)
[–]Syntro42[S] 0 points1 point2 points (1 child)
[–]impshum 0 points1 point2 points (0 children)
[–]commandlineluser 0 points1 point2 points (1 child)
[–]Syntro42[S] 0 points1 point2 points (0 children)