mickaelwalter / wp-json-scraper Goto Github PK
View Code? Open in Web Editor NEWScrapes WordPress data using the WP-JSON API activated by default since WordPress 4.7
License: MIT License
Scrapes WordPress data using the WP-JSON API activated by default since WordPress 4.7
License: MIT License
$ python wp-json-scraper/WPJsonScraper.py https://somepage.com/ \
--export-posts somepage/posts \
--export-pages somepage/pages \
--export-comments somepage/comments \
--download-media somepage/media
[*] Testing connectivity with the server
[+] Connection OK
Total number of entries: 2205
|██████████████████████████████████████████████████████████████████████| 100.0%
Total number of entries: 64
|██████████████████████████████████████████████████████████████████████| 100.0%
Total number of entries: 27
|██████████████████████████████████████████████████████████████████████| 100.0%
Total number of entries: 2
|██████████████████████████████████████████████████████████████████████| 100.0%
[+] Exported 2205 posts to somepage/posts
Total number of entries: 78
|██████████████████████████████████████████████████████████████████████| 100.0%
[+] Exported 78 pages to somepage/pages
Total number of entries: 2205
|██████████████████████████████████████████████████████████████████████| 100.0%
Traceback (most recent call last):
File "wp-json-scraper/WPJsonScraper.py", line 394, in <module>
main()
File "wp-json-scraper/WPJsonScraper.py", line 365, in main
post_list = scanner.get_posts(True)
File "wp-json-scraper/lib/wpapi.py", line 394, in get_posts
self.posts = self.update_cache(self.posts, posts, total_entries, start, num)
File "wp-json-scraper/lib/wpapi.py", line 345, in update_cache
if start >= total_entries:
TypeError: '>=' not supported between instances of 'NoneType' and 'int'
How can I export only the post in the link you specified instead of all the posts?
Like;
.\WPJsonScraper.py --one-post "https://guvenliksistemleri.net/en-iyi-kaliteli-guvenlik-kamerasi-markalari/"
Hi there,
Upon running this, I get an error that many files are missing their encoding.
SyntaxError: Non-ASCII character '\xc3' in file WPJsonScraper.py on line 5, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details
So I just follow the error and give each file a utf-8 encoding and re-run the program. Then what happens next is that that it's missing a module:
Traceback (most recent call last):
File "WPJsonScraper.py", line 31, in <module>
from lib.wpapi import WPApi
File "/Users/Nirawit/Desktop/wp-json-scraper-0.4/lib/wpapi.py", line 26, in <module>
from urllib.parse import urlencode
ImportError: No module named parse
How do I go about fixing this? Thank you
Hello is it possible to export to JSON instead of HTML?
python3 WPJsonScraper.py http://OOOOOO.com --export-posts /posts
�[94m[*] Testing connectivity with the server�[0m
�[92m[+] Connection OK�[0m
Number of entries: 991
|██████████████████████████████████████████████████████████████████████| 100.0%
Number of entries: 635
|██████████████████████████████████████████████████████████████████████| 100.0%
Number of entries: 7
|██████████████████████████████████████████████████████████████████████| 100.0%
Number of entries: 2
|██████████████████████████████████████████████████████████████████████| 100.0%
Traceback (most recent call last):
File "WPJsonScraper.py", line 360, in
main()
File "WPJsonScraper.py", line 319, in main
post_number = Exporter.export_posts(posts_list,
File "C:\deneme\wp-json-scraper\lib\exporter.py", line 210, in export_posts
post_file.write(buffer)
File "C:\Python38\lib\encodings\cp1254.py", line 19, in encode
return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode characters in position 6146-6152: character maps to
Hi can make buddypress bp work? Please thank you
This is a placeholder for a PR coming soon.
How can I solve this ?
python .\WPJsonScraper.py -i "https://guvenliksistemleri.net"
Traceback (most recent call last):
File ".\WPJsonScraper.py", line 365, in <module>
main()
File ".\WPJsonScraper.py", line 231, in main
basic_info = scanner.get_basic_info()
File "C:\Users\User\Desktop\wp-json-scraper-master\wp-json-scraper-master\lib\wpapi.py", line 89, in get_basic_info
self.basic_info = req.json().read().decode('utf-8-sig')
File "C:\python3\lib\site-packages\requests\models.py", line 897, in json
return complexjson.loads(self.text, **kwargs)
File "C:\python3\lib\json\__init__.py", line 337, in loads
raise JSONDecodeError("Unexpected UTF-8 BOM (decode using utf-8-sig)",
json.decoder.JSONDecodeError: Unexpected UTF-8 BOM (decode using utf-8-sig): line 1 column 1 (char 0)
hi, great work
i'm having difficulty with buddypress/buddydrive/xprofile installs. also, is it possible to list wp-blocks? thank you thank you tha nk you!
hi macos
last version
error 406 but if i try to open in my browser open normaly is because need a reffer?
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.