Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
crawlersNoticias
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
4
Issues
4
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
m3
crawlersNoticias
Commits
dbdb00c3
Commit
dbdb00c3
authored
Dec 03, 2017
by
Renán Sosa Guillen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
crawlers
parent
7d116982
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
noticias.py
descarga_por_dia/unoMasUno/unoMasUno/spiders/noticias.py
+3
-3
noticias.pyc
descarga_por_dia/unoMasUno/unoMasUno/spiders/noticias.pyc
+0
-0
No files found.
descarga_por_dia/unoMasUno/unoMasUno/spiders/noticias.py
View file @
dbdb00c3
...
...
@@ -43,9 +43,9 @@ class QuotesSpider(scrapy.Spider):
day
=
getattr
(
self
,
'day'
,
None
)
self
.
date_parser
=
{
'enero'
:
1
,
'febrero'
:
2
,
'marzo'
:
3
,
'abril'
:
4
,
'mayo'
:
5
,
'junio'
:
6
,
'julio'
:
7
,
'agosto'
:
8
,
'septiembre'
:
9
,
'octubre'
:
10
,
'noviembre'
:
9
,
'diciembre'
:
12
}
'septiembre'
:
9
,
'octubre'
:
10
,
'noviembre'
:
11
,
'diciembre'
:
12
}
self
.
baseURL
=
'http://www.unomasuno.com.mx/
index.php/
'
+
year
+
'/'
+
month
+
'/'
+
day
self
.
baseURL
=
'http://www.unomasuno.com.mx/'
+
year
+
'/'
+
month
+
'/'
+
day
yield
scrapy
.
Request
(
url
=
self
.
baseURL
,
callback
=
self
.
parse
)
...
...
@@ -91,7 +91,7 @@ class QuotesSpider(scrapy.Spider):
d
=
response
.
xpath
(
'//p[@class="post-meta"]/span/text()'
)
.
extract_first
()
d
=
d
.
replace
(
','
,
''
)
.
split
(
' '
)
item
[
'date'
]
=
datetime
(
int
(
d
[
2
]),
self
.
date_parser
[
d
[
0
]
.
lower
()],
int
(
d
[
1
]),
tzinfo
=
self
.
tz
)
.
isoformat
(
'T'
)
item
[
'date'
]
=
datetime
(
int
(
d
[
2
]),
self
.
date_parser
[
d
[
1
]
.
lower
()],
int
(
d
[
0
]),
tzinfo
=
self
.
tz
)
.
isoformat
(
'T'
)
item
[
'topic'
]
=
response
.
xpath
(
'//span[@typeof="v:Breadcrumb"]/a/text()'
)
.
extract
()[
1
]
item
[
'title'
]
=
response
.
xpath
(
'//*[@class="post-inner"]/h1/span/text()'
)
.
extract_first
()
...
...
descarga_por_dia/unoMasUno/unoMasUno/spiders/noticias.pyc
View file @
dbdb00c3
No preview for this file type
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