mirror of
https://gh.wpcy.net/https://github.com/SoloSynth1/wordpress-scraper.git
synced 2026-04-29 14:28:54 +08:00
19 lines
780 B
Python
19 lines
780 B
Python
from legacy.crawler import crawler
|
|
import os
|
|
|
|
url = "https://www.lastwatchdog.com"
|
|
output_dir = os.path.join('.', 'data', 'lastwatchdog')
|
|
headers = {
|
|
'Accept':'application/json, text/javascript, */*; q=0.01',
|
|
'Accept-Encoding':'*',
|
|
'Accept-Language':'zh-CN,zh;q=0.8',
|
|
'cookie':'__cfduid=dfea0ee9fe9b8670fdd8222535adb9ec21540527308; __unam=c02b1ec-166acddd608-734d3c03-1',
|
|
'Connection':'keep-alive',
|
|
'User-Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36',
|
|
'X-Requested-With':'XMLHttpRequest'
|
|
}
|
|
|
|
if __name__ == "__main__":
|
|
from legacy import common_crawl
|
|
wpc = crawler.WordPressCrawler(url, headers, output_dir)
|
|
common_crawl(wpc)
|