willkoehrsen / wikipedia-data-science Goto Github PK
View Code? Open in Web Editor NEWWorking with and analyzing Wikipedia Data
Working with and analyzing Wikipedia Data
Hi @WillKoehrsen , I am trying to execute on the code in the notebook and ran into an error in the xml parser code. I am getting an SAX error at this code snippet. handler = WikiXmlHandler()
parser = xml.sax.make_parser()
parser.setContentHandler(handler)
#handler._pages
for l in lines[-165:-109]:
parser.feed(l)
The stack trace is as follows
ExpatError Traceback (most recent call last)
myprojectpath\lib\xml\sax\expatreader.py in feed(self, data, isFinal)
216 # except when invoked from close.
--> 217 self._parser.Parse(data, isFinal)
218 except expat.error as e:
ExpatError: syntax error: line 2, column 0
During handling of the above exception, another exception occurred:
SAXParseException Traceback (most recent call last)
in ()
40
41 for l in lines[-165:-109]:
---> 42 parser.feed(l)
43
44 print(handler._pages)
myprojectpath\lib\xml\sax\expatreader.py in feed(self, data, isFinal)
219 exc = SAXParseException(expat.ErrorString(e.code), e, self)
220 # FIXME: when to invoke error()?
--> 221 self._err_handler.fatalError(exc)
222
223 def _close_source(self):
myprojectpath\lib\xml\sax\handler.py in fatalError(self, exception)
36 def fatalError(self, exception):
37 "Handle a non-recoverable error."
---> 38 raise exception
39
40 def warning(self, exception):
SAXParseException: :2:0: syntax error
Appreciate your time in helping me proceed further and handling this issue. Thanks
The Wiki has the wrong link to the file https://github.com/WillKoehrsen/wikipedia-data-science/blob/master/notebooks/Downloading%20and%20Parsing%20Wikipedia%20Articles.ipynb
the file is on master only the link to redirect the file on the Wiki is not working.
I'm getting so many errors, as I'm not sure from which Jupyter notebook I should start.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.