Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: 'NoneType' object has no attribute 'find' #7

Open
gkroon opened this issue Sep 8, 2024 · 1 comment · May be fixed by SmallKingfisher/wikiraider#1
Open

AttributeError: 'NoneType' object has no attribute 'find' #7

gkroon opened this issue Sep 8, 2024 · 1 comment · May be fixed by SmallKingfisher/wikiraider#1

Comments

@gkroon
Copy link

gkroon commented Sep 8, 2024

Hi, I'm having trouble running this tool. It throws an error and I'm not sure how to solve this.

I'm running Python 3.11 inside a virtualenv, installed the required packages, and ran wikiraider like so:

$ virtualenv --python="/usr/bin/python3.11" venv
$ . venv/bin/activate.fish
$ pip install -r requirements.txt
[...]
$ ./wikiraider.py parse -u https://dumps.wikimedia.org/nlwiki/20240901

██╗    ██╗██╗██╗  ██╗██╗██████╗  █████╗ ██╗██████╗ ███████╗██████╗
██║    ██║██║██║ ██╔╝██║██╔══██╗██╔══██╗██║██╔══██╗██╔════╝██╔══██╗
██║ █╗ ██║██║█████╔╝ ██║██████╔╝███████║██║██║  ██║█████╗  ██████╔╝
██║███╗██║██║██╔═██╗ ██║██╔══██╗██╔══██║██║██║  ██║██╔══╝  ██╔══██╗
╚███╔███╔╝██║██║  ██╗██║██║  ██║██║  ██║██║██████╔╝███████╗██║  ██║
 ╚══╝╚══╝ ╚═╝╚═╝  ╚═╝╚═╝╚═╝  ╚═╝╚═╝  ╚═╝╚═╝╚═════╝ ╚══════╝╚═╝  ╚═╝

Version 1.0.0 - Copyright (c) 2020 Northwave B.V. (www.northwave-security.com)

[INFO] Investigating file nlwiki-20240901-pages-articles1.xml-p1p134538.bz2
[SUCCESS] Identified XML file nlwiki-20240901-pages-articles1.xml-p1p134538.bz2
[INFO] Investigating file nlwiki-20240901-pages-articles2.xml-p134539p484052.bz2
[SUCCESS] Identified XML file nlwiki-20240901-pages-articles2.xml-p134539p484052.bz2
[INFO] Investigating file nlwiki-20240901-pages-articles3.xml-p484053p1092038.bz2
[SUCCESS] Identified XML file nlwiki-20240901-pages-articles3.xml-p484053p1092038.bz2
[INFO] Investigating file nlwiki-20240901-pages-articles4.xml-p1092039p2069270.bz2
[SUCCESS] Identified XML file nlwiki-20240901-pages-articles4.xml-p1092039p2069270.bz2
[INFO] Investigating file nlwiki-20240901-pages-articles5.xml-p2069271p3569270.bz2
[SUCCESS] Identified XML file nlwiki-20240901-pages-articles5.xml-p2069271p3569270.bz2
[INFO] Investigating file nlwiki-20240901-pages-articles5.xml-p3569271p3907920.bz2
[SUCCESS] Identified XML file nlwiki-20240901-pages-articles5.xml-p3569271p3907920.bz2
[INFO] Investigating file nlwiki-20240901-pages-articles6.xml-p3907921p5407920.bz2
[SUCCESS] Identified XML file nlwiki-20240901-pages-articles6.xml-p3907921p5407920.bz2
[INFO] Investigating file nlwiki-20240901-pages-articles6.xml-p5407921p5892769.bz2
[SUCCESS] Identified XML file nlwiki-20240901-pages-articles6.xml-p5407921p5892769.bz2
[INFO] Using cached XML file on disk: nlwiki-20240901-pages-articles1.xml-p1p134538.bz2
[INFO] Extracting nlwiki-20240901-pages-articles1.xml-p1p134538.bz2.
143769600it [00:15, 9075865.34it/s]
[SUCCESS] Extraction finished.
[INFO] Using cached XML file on disk: nlwiki-20240901-pages-articles2.xml-p134539p484052.bz2
[INFO] Extracting nlwiki-20240901-pages-articles2.xml-p134539p484052.bz2.
162406400it [00:19, 8413059.51it/s]
[SUCCESS] Extraction finished.
[INFO] Using cached XML file on disk: nlwiki-20240901-pages-articles3.xml-p484053p1092038.bz2
[INFO] Extracting nlwiki-20240901-pages-articles3.xml-p484053p1092038.bz2.
219033600it [00:25, 8542397.57it/s]
[SUCCESS] Extraction finished.
[INFO] Using cached XML file on disk: nlwiki-20240901-pages-articles4.xml-p1092039p2069270.bz2
[INFO] Extracting nlwiki-20240901-pages-articles4.xml-p1092039p2069270.bz2.
318668800it [00:36, 8683402.10it/s]
[SUCCESS] Extraction finished.
[INFO] Using cached XML file on disk: nlwiki-20240901-pages-articles5.xml-p2069271p3569270.bz2
[INFO] Extracting nlwiki-20240901-pages-articles5.xml-p2069271p3569270.bz2.
298905600it [00:42, 7066183.35it/s]
[SUCCESS] Extraction finished.
[INFO] Using cached XML file on disk: nlwiki-20240901-pages-articles5.xml-p3569271p3907920.bz2
[INFO] Extracting nlwiki-20240901-pages-articles5.xml-p3569271p3907920.bz2.
76902400it [00:10, 7356411.51it/s]
[SUCCESS] Extraction finished.
[INFO] Using cached XML file on disk: nlwiki-20240901-pages-articles6.xml-p3907921p5407920.bz2
[INFO] Extracting nlwiki-20240901-pages-articles6.xml-p3907921p5407920.bz2.
418201600it [00:47, 8778386.69it/s]
[SUCCESS] Extraction finished.
[INFO] Using cached XML file on disk: nlwiki-20240901-pages-articles6.xml-p5407921p5892769.bz2
[INFO] Extracting nlwiki-20240901-pages-articles6.xml-p5407921p5892769.bz2.
240128000it [00:27, 8769140.45it/s]
[SUCCESS] Extraction finished.
[INFO] Iterating all of the XML files and pushing pages to queue. This might take a while...
[INFO] In the meantime the consumers are already processing the pages...
Traceback (most recent call last):
  File "/home/gkroon/git/wikiraider/./wikiraider.py", line 143, in <module>
    main()
  File "/home/gkroon/git/wikiraider/./wikiraider.py", line 139, in main
    ActionParse(args).run()
  File "/home/gkroon/git/wikiraider/wikiraider/actions/ActionParse.py", line 97, in run
    text = revision.find('.//{http://www.mediawiki.org/xml/export-0.10/}text')
           ^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'find'

Can anyone reproduce and help me understand what needs to be fixed?

@gkroon gkroon linked a pull request Sep 9, 2024 that will close this issue
@gkroon
Copy link
Author

gkroon commented Sep 9, 2024

It turned out to be an easy fix and I fixed it over here: gkroon@052bc87. Since I used https://github.com/SmallKingfisher/wikiraider, I opened a PR there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

1 participant