I want to be able to make a list of users who have commented but am unable to find the iframe on the page when pulling it with BeautifulSoup. The comments are within the iframe and for some reason when I pull the html with BeautifulSoup, there does not seem to be an iframe in it. I know there is an iframe that holds the comments because I looked at the html on the webpage in order to try and drill down and pull what I needed with BeautifulSoup.
from bs4 import BeautifulSoup
from urllib import urlopen
url = urlopen("http://www.datpiff.com/Curreny-Alchemist-Carrollton-Heist-mixtape.766213.html")
bsObj = BeautifulSoup(url,"html.parser")
frame_list = bsObj.findAll("iframe")
for frame in frame_list:
print(frame)
However, I do find this javascript that may be the answer to what I need but I want to ask, am I suppose to run this javascript somehow in order for the server holding this page to believe I am a user and then the iframe shows up?
<script language="javascript">
var disqus_shortname = 'datpiff4';
/* * * DON'T EDIT BELOW THIS LINE * * */
(function () {
var s = document.createElement('script'); s.async = true;
s.type = 'text/javascript';
s.src = '//' + disqus_shortname + '.disqus.com/count.js';
(document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s);
}());
</script>
I want to be able to get this iframe without having to open up a browser like when using selenium. Is this possible? If not, what can I use to do this other than BeautifulSoup?