-
Notifications
You must be signed in to change notification settings - Fork 47
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
Dataset Collector #1, Bykova Ekaterina - 19FPL2 #38
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is right time to implement scrapper. The deadline is coming.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good for now. Waiting for green PR
@@ -7,3 +7,6 @@ | |||
PROJECT_ROOT = os.path.dirname(os.path.realpath(__file__)) | |||
ASSETS_PATH = os.path.join(PROJECT_ROOT, 'tmp', 'articles') | |||
CRAWLER_CONFIG_PATH = os.path.join(PROJECT_ROOT, 'crawler_config.json') | |||
HEADERS = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good
crawler_config.json
Outdated
"max_number_articles_to_get_from_one_seed": 0 | ||
"base_urls": ["https://express-kamchatka1.ru/sobytiya.html"], | ||
"total_articles_to_find_and_parse": 15, | ||
"max_number_articles_to_get_from_one_seed": 15 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
accepted
scrapper.py
Outdated
from datetime import datetime | ||
from bs4 import BeautifulSoup | ||
from article import Article | ||
from constants import CRAWLER_CONFIG_PATH |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you may import them in one line
scrapper.py
Outdated
response = requests.get(url, headers=HEADERS) | ||
if response: | ||
content = response.text | ||
links = self._extract_url(BeautifulSoup(content, 'html.parser')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you may try "lxml" option here
Nice commits namings BTW) |
'puk' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see you have different sites specified in crawler and in our table: http://express-kamchatka1.ru/ and https://www.e1.ru/news/ is this correct?
No description provided.