I'm using this code for non-JavaScript pages:
session = HTMLSession()
url = session.get("https://.......")
spoon = BeautifulSoup(url.text, "html.parser")
preTitle = spoon.find_all('title')
preTitleStr = str(preTitle)
a = preTitleStr.replace('<title>','')
Title = a.replace('</title>','')
print(Title)
This does not work with JS tho, so I tried:
session = HTMLSession()
qwerty = session.get("https://twitter.com/aProfile/")
qwerty.html.render()
asdf = qwerty.html.find('title')
print(str(asdf))
How do I grab the title of a JS page (the one that shows on the actual tab) with python-requests and beautifulsoup?