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
ed9259da
Commit
ed9259da
authored
Jun 12, 2017
by
Vasyl Bodnaruk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bug in replace
parent
afea8191
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
4 deletions
+11
-4
company_maker.py
exa/exa/helpers/company_maker.py
+8
-1
mobihealthnews.py
exa/exa/spiders/mobihealthnews.py
+0
-1
techcrunch.py
exa/exa/spiders/techcrunch.py
+3
-2
No files found.
exa/exa/helpers/company_maker.py
View file @
ed9259da
...
@@ -32,5 +32,12 @@ class CompanyMaker:
...
@@ -32,5 +32,12 @@ class CompanyMaker:
self
.
companies
.
append
(
Company
(
i
.
id
,
'http://www.mobihealthnews.com/tag/'
+
tag
,
43
,
2
,
2
,
i
.
name
))
self
.
companies
.
append
(
Company
(
i
.
id
,
'http://www.mobihealthnews.com/tag/'
+
tag
,
43
,
2
,
2
,
i
.
name
))
def
_make_list_for_tc
(
self
):
def
_make_list_for_tc
(
self
):
def
name_for_search
(
name
):
comp
=
name
.
split
(
' '
)
for
i
in
self
.
in_site
:
for
i
in
self
.
in_site
:
self
.
companies
.
append
(
Company
(
i
.
id
,
'https://techcrunch.com/tag/'
+
i
.
name
,
81
,
2
,
2
,
i
.
name
))
tag
=
i
.
name
\ No newline at end of file
if
tag
.
find
(
' '
):
tag
=
tag
.
replace
(
' '
,
'-'
)
if
tag
.
find
(
'.'
):
tag
=
tag
.
replace
(
'.'
,
'-'
)
self
.
companies
.
append
(
Company
(
i
.
id
,
'https://techcrunch.com/tag/'
+
tag
,
81
,
2
,
2
,
i
.
name
))
\ No newline at end of file
exa/exa/spiders/mobihealthnews.py
View file @
ed9259da
...
@@ -57,7 +57,6 @@ class MobiHealthNewsSpider(scrapy.Spider):
...
@@ -57,7 +57,6 @@ class MobiHealthNewsSpider(scrapy.Spider):
print
(
has_next
,
next_url
)
print
(
has_next
,
next_url
)
if
has_next
:
if
has_next
:
# pass
yield
scrapy
.
Request
(
next_url
,
callback
=
self
.
parse
,
meta
=
{
'company'
:
response
.
meta
[
'company'
],
'post_id'
:
0
})
yield
scrapy
.
Request
(
next_url
,
callback
=
self
.
parse
,
meta
=
{
'company'
:
response
.
meta
[
'company'
],
'post_id'
:
0
})
except
BaseException
as
e
:
except
BaseException
as
e
:
...
...
exa/exa/spiders/techcrunch.py
View file @
ed9259da
...
@@ -17,7 +17,7 @@ class TechcrunchSpider(scrapy.Spider):
...
@@ -17,7 +17,7 @@ class TechcrunchSpider(scrapy.Spider):
def
__init__
(
self
,
*
args
,
**
kwargs
):
def
__init__
(
self
,
*
args
,
**
kwargs
):
self
.
condition
=
kwargs
.
get
(
'query'
)
self
.
condition
=
kwargs
.
get
(
'query'
)
self
.
query
=
"SELECT id, name, country FROM wp_esi_entity WHERE 1 and id=3"
self
.
query
=
"SELECT id, name, country FROM wp_esi_entity WHERE 1 and id=
1
3"
if
self
.
condition
:
if
self
.
condition
:
print
(
self
.
condition
)
print
(
self
.
condition
)
self
.
query
+=
' or {}'
.
format
(
self
.
condition
)
self
.
query
+=
' or {}'
.
format
(
self
.
condition
)
...
@@ -55,7 +55,8 @@ class TechcrunchSpider(scrapy.Spider):
...
@@ -55,7 +55,8 @@ class TechcrunchSpider(scrapy.Spider):
item
[
'post_id'
]
=
response
.
meta
[
'post_id'
]
item
[
'post_id'
]
=
response
.
meta
[
'post_id'
]
yield
item
if
item
[
'title'
]:
yield
item
has_next
=
response
.
xpath
(
"//div[contains(@class, 'river-nav')]//li[contains(@class, 'next')]/a/@href"
)
.
extract_first
()
has_next
=
response
.
xpath
(
"//div[contains(@class, 'river-nav')]//li[contains(@class, 'next')]/a/@href"
)
.
extract_first
()
if
has_next
:
if
has_next
:
...
...
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