Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
E
esi-table-data
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
esi-data-scrapping
esi-table-data
Commits
39c0c968
Commit
39c0c968
authored
Oct 17, 2017
by
Andrii Marynets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix CB
parent
ea06c447
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
7 deletions
+8
-7
settings.py
exa/exa/settings.py
+3
-3
cb.py
exa/exa/spiders/cb.py
+5
-4
No files found.
exa/exa/settings.py
View file @
39c0c968
...
...
@@ -55,7 +55,7 @@ DEFAULT_REQUEST_HEADERS = {
# Enable or disable spider middlewares
# See http://scrapy.readthedocs.org/en/latest/topics/spider-middleware.html
SPIDER_MIDDLEWARES
=
{
#
'scrapy_splash.SplashDeduplicateArgsMiddleware': 100,
'scrapy_splash.SplashDeduplicateArgsMiddleware'
:
100
,
}
DUPEFILTER_CLASS
=
'scrapy_splash.SplashAwareDupeFilter'
# Enable or disable downloader middlewares
...
...
@@ -65,9 +65,9 @@ DOWNLOADER_MIDDLEWARES = {
'scrapy_splash.SplashMiddleware'
:
725
,
'scrapy.downloadermiddlewares.httpcompression.HttpCompressionMiddleware'
:
810
,
'scrapy.downloadermiddlewares.useragent.UserAgentMiddleware'
:
None
,
'scrapy_fake_useragent.middleware.RandomUserAgentMiddleware'
:
400
,
#
'scrapy_fake_useragent.middleware.RandomUserAgentMiddleware': 400,
'scrapy.downloadermiddlewares.retry.RetryMiddleware'
:
90
,
'scrapy_crawlera.CrawleraMiddleware'
:
750
'scrapy_crawlera.CrawleraMiddleware'
:
None
}
# Enable or disable extensions
...
...
exa/exa/spiders/cb.py
View file @
39c0c968
...
...
@@ -14,10 +14,9 @@ api_key = get_project_settings().get('CRAWLERA_APIKEY')
class
CbSpider
(
BaseSpider
):
name
=
"cb"
allowed_domains
=
[
"www.crunchbase.com"
]
handle_httpstatus_list
=
[
470
]
# crawlera_enabled = True
# crawlera_apikey = api_key
# start_urls = ['http://www.crunchbase.com/organization/sense-ly/press/']
co
=
0
def
__init__
(
self
,
*
args
,
**
kwargs
):
...
...
@@ -31,17 +30,19 @@ class CbSpider(BaseSpider):
try
:
yield
SplashRequest
(
url
=
i
.
url
,
callback
=
self
.
parse
,
endpoint
=
'execute'
,
meta
=
{
'company'
:
i
,
'post_id'
:
0
},
args
=
{
'wait'
:
5
,
'lua_source'
:
self
.
LUA_SOURCE
,
'
crawlera_user
'
:
self
.
settings
[
'CRAWLERA_APIKEY'
],
'
apikey
'
:
self
.
settings
[
'CRAWLERA_APIKEY'
],
},
cache_args
=
[
'lua_source'
],
#
cache_args=['lua_source'],
)
except
:
pass
def
parse
(
self
,
response
):
print
(
response
.
body
)
rows
=
response
.
xpath
(
".//div[@class='grid-body']/div"
)
company
=
response
.
meta
[
'company'
]
is_duplicate
=
False
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment