-
Notifications
You must be signed in to change notification settings - Fork 0
Update crawldata.py #1
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
base: saraskardelly-patch-1
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -121,5 +121,52 @@ | |
| ], | ||
| 'regex-filter': ['.*[a-z]+.*$'] | ||
| } | ||
| }, | ||
| 'bloomberg': { | ||
| 'url-prefix': 'https://www.bloomberg.com', | ||
| 'article-links': { | ||
| 'overview-urls': ['/markets', '/technology', '/politics', '/world'], | ||
| 'find-tags': [ # Hierarchy | ||
| {'type': 'include', 'name': 'header', 'attrs': {'class': 'story-package-module_ _stories'}}, | ||
| {'type': 'include', 'name': 'a', 'attrs': {'class': 'story-package-module_ _story_ _headline-link'}} | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The crawler cannot handle multiple class definitions separated with whitespaces. Either try to pass an array (untested) or reduce these specifications. |
||
| ], | ||
| 'link-prefix': ('/news/articles/') | ||
| }, | ||
| 'heading': { | ||
| 'find-tags': [ # Hierarchy | ||
| {'type': 'include', 'name': 'h1', 'attrs': {'class': 'lede-text-v2_ _hed'}} | ||
| ] | ||
| }, | ||
| 'article': { | ||
| 'find-tags': [ # Hierarchy | ||
| {'type': 'include', 'name': 'div', 'attrs': {'class': 'body-copy-v2 fence-body'}}, | ||
| {'type': 'include', 'name': 'p', 'attrs': {}}, | ||
| {'type': 'excludeParent', 'name': 'div', 'attrs': {'class': 'bb-unsupported-inset'}}, | ||
| ], | ||
| 'regex-filter': ['.*[a-z]+.*$'] | ||
| } | ||
| }, | ||
| 'washingtonpost': { | ||
| 'url-prefix': 'https://www.washingtonpost.com', | ||
| 'article-links': { | ||
| 'overview-urls': ['/politics', '/world', '/business', '/technology', '/sports'], | ||
| 'find-tags': [ # Hierarchy | ||
| {'type': 'include', 'name': 'header', 'attrs': {'class': 'headline'}}, | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here. |
||
| {'type': 'include', 'name': 'a', 'attrs': {}} | ||
| ], | ||
| 'link-prefix': ('/2023/05/') | ||
| }, | ||
| 'heading': { | ||
| 'find-tags': [ # Hierarchy | ||
| {'type': 'include', 'name': 'h1', 'attrs': {'data-qa': 'headline'}} | ||
| ] | ||
| }, | ||
| 'article': { | ||
| 'find-tags': [ # Hierarchy | ||
| {'type': 'include', 'name': 'article', 'attrs': {'itemprop': 'articleBody'}}, | ||
| {'type': 'include', 'name': 'p', 'attrs': {}}, | ||
| ], | ||
| 'regex-filter': ['.*[a-z]+.*$'] | ||
| } | ||
| } | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.
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.
This configuration seems not to find any article links since there is no container named 'header' in the html page of bloomberg.com. You might have forgotten to change the container name in this line (copy-paste mistake?).