When I executed that same code on my laptop using Jupyter, I got the following error
AttributeError
Traceback (most recent call last) in # form cycles)
excludedPages = filter(isInternalNode, getChildren("http://www.quora.com/directory"))
-->excludedPages.append("http://www.quora.com")
excludedPages.append("http://www.quora.com#")
excludedPages.append("http://www.quora.com/")
AttributeError: 'filter' object has no attribute 'append'
The code is here- https://github.com/jessicatysu/quora/blob/master/numfollowers.py
This code is for Python 2 - you can see
printwithout()which works only in Python 2.But Python 2 has also other differences. In Python 2
filter()createslistbut in Python 3filter()is "lazy" and it doesn't create list at once and in some situations you have to uselist()to convertfilter()tolistAnd you have to do it before you use
append()EDIT:
Here is code which runs without error.
In code you can see comments
# changedwith more information.But problem is that this script is 7 years old (from 2013) and
Quorachanged HTML:/directorydoesn't display list of users(probably for security or
GDPRGeneral Data Protection Regulation)mechanizecan't run JavaScriptso code is useless :)
You would have to use
Seleniumto control real web browser which can run JavaScript. And you would have to analyze web pages to create new code.