-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from experius/feature/PWAI-460
Feature/pwai 460
- Loading branch information
Showing
9 changed files
with
213 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
from scrapy.http import Response | ||
from scrapy.spiders import SitemapSpider | ||
from seosnap_cachewarmer.state import SeosnapState | ||
import itertools | ||
from scrapy.http import Request, XmlResponse | ||
|
||
|
||
class SeoSnapSitemapRefresherTest(SitemapSpider): | ||
state: SeosnapState | ||
name = 'Seosnap' | ||
sitemap_urls = ['http://192.168.128.5/pub/sitemap/sitemap.xml'] | ||
|
||
def __init__(self, *args, **kwargs) -> None: | ||
print(' -------------- sitemap init!!! ----------- ') | ||
self.state = SeosnapState(*args, **kwargs) | ||
self.name = self.state.get_name() | ||
|
||
print(self.state.sitemap_urls()) | ||
for uri in self.state.sitemap_urls(): | ||
print(uri) | ||
|
||
super().__init__(sitemap_urls=self.state.sitemap_urls()) | ||
|
||
def headers(self): | ||
return {} | ||
|
||
def parse(self, response): | ||
print("parse") | ||
print("parse") | ||
print("parse") | ||
print("parse") | ||
print("parse") | ||
print(response.url) | ||
|
||
# yield { | ||
# 'url': response.url | ||
# } | ||
|
||
|
||
class SeoSnapSitemapRefresher(SitemapSpider): | ||
name = 'test' | ||
state: SeosnapState | ||
|
||
def __init__(self, *args, **kwargs) -> None: | ||
print('>>>>>>----- start sitemap ------<<<<<') | ||
self.state = SeosnapState(*args, **kwargs) | ||
super().__init__(sitemap_urls=self.state.sitemap_urls()) | ||
# self.state = state | ||
|
||
def parse(self, response): | ||
print('test') | ||
print(response) | ||
|
||
yield response | ||
|
||
def get_urls(self): | ||
print('GET get_urls') | ||
|
||
for url in self.state.sitemap_urls(): | ||
yield Request(url, self.parse) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters