Created
February 1, 2020 17:36
-
-
Save Suor/b4f8c4d9a353ea29a918dc7381aa6a80 to your computer and use it in GitHub Desktop.
aioscrape perekrestok example
This file contains hidden or 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
from aioscrape import settings, fetch, run | |
from parsechain import C | |
async def scrape(): | |
resp = await fetch('https://www.perekrestok.ru/') | |
print(resp.css('.xf-product').map({ | |
'id': C.attr('data-id').int, | |
'name': C.attr('data-gtm-product-name') | |
})) | |
def main(): | |
with settings(): | |
run(scrape()) | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment