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
37b5fa54
Commit
37b5fa54
authored
Jul 18, 2017
by
Vasyl Bodnaruk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add searching tag on aitopics
parent
d1419291
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
aitop.py
exa/exa/spiders/aitop.py
+5
-2
No files found.
exa/exa/spiders/aitop.py
View file @
37b5fa54
...
@@ -68,8 +68,9 @@ class AitopSpider(BaseSpider):
...
@@ -68,8 +68,9 @@ class AitopSpider(BaseSpider):
def
build_items
(
self
,
response
):
def
build_items
(
self
,
response
):
try
:
try
:
items
=
list
()
items
=
list
()
rows
=
response
.
xpath
(
".//div[contains(@class, 'summaries')]//div[@class='row']"
)
rows
=
response
.
xpath
(
".//div[contains(@class, 'summaries')]"
)
for
i
in
rows
:
for
r
in
rows
:
i
=
r
.
xpath
(
"//div[@class='row']"
)
item
=
ExaItem
()
item
=
ExaItem
()
item
[
'date'
]
=
dateparser
.
parse
(
i
.
xpath
(
".//time/@datetime"
)
.
extract_first
())
.
replace
(
tzinfo
=
None
)
item
[
'date'
]
=
dateparser
.
parse
(
i
.
xpath
(
".//time/@datetime"
)
.
extract_first
())
.
replace
(
tzinfo
=
None
)
item
[
'title'
]
=
''
.
join
(
i
.
xpath
(
".//div[contains(@class, 'col-xs-12')]/h3/a//text()"
)
.
extract
())
item
[
'title'
]
=
''
.
join
(
i
.
xpath
(
".//div[contains(@class, 'col-xs-12')]/h3/a//text()"
)
.
extract
())
...
@@ -77,6 +78,8 @@ class AitopSpider(BaseSpider):
...
@@ -77,6 +78,8 @@ class AitopSpider(BaseSpider):
item
[
'url'
]
=
i
.
xpath
(
".//div[contains(@class, 'col-xs-12')]/h3/a/@href"
)
.
extract_first
()
item
[
'url'
]
=
i
.
xpath
(
".//div[contains(@class, 'col-xs-12')]/h3/a/@href"
)
.
extract_first
()
item
.
update
(
self
.
get_common_items
(
response
.
meta
[
'company'
]))
item
.
update
(
self
.
get_common_items
(
response
.
meta
[
'company'
]))
item
[
'post_id'
]
=
response
.
meta
[
'post_id'
]
item
[
'post_id'
]
=
response
.
meta
[
'post_id'
]
item
[
'tags'
]
=
r
.
xpath
(
".//div[@class='row hidden-xs']//div[@title='Concept Tags']//a[@class='filter btn btn-link']/text()"
)
.
extract
()
items
.
append
(
item
)
items
.
append
(
item
)
return
items
return
items
except
:
except
:
...
...
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