Skip to content

Commit

Permalink
Merge pull request #20 from tinduong94/master
Browse files Browse the repository at this point in the history
first-child css selector is not working in some cases
  • Loading branch information
Ronald Schmidt authored Oct 12, 2017
2 parents 4f41c23 + b3c841d commit 1493dc1
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions scrapcore/parser/google_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,19 @@ class GoogleParser(Parser):
'us_ip': {
'container': '#center_col',
'result_container': 'div.g ',
'link': 'h3.r > a:first-child::attr(href)',
'link': 'h3.r > a:first-of-type::attr(href)',
'snippet': 'div.s span.st::text',
'title': 'h3.r > a:first-child::text',
'title': 'h3.r > a:first-of-type::text',
'visible_link': 'cite::text',
'rating': 'div.f.slp::text',
'sitelinks': 'div.osl::text'
},
'de_ip': {
'container': '#center_col',
'result_container': 'li.g ',
'link': 'h3.r > a:first-child::attr(href)',
'link': 'h3.r > a:first-of-type::attr(href)',
'snippet': 'div.s span.st::text',
'title': 'h3.r > a:first-child::text',
'title': 'h3.r > a:first-of-type::text',
'visible_link': 'cite::text',
'rating': 'div.f.slp::text',
'sitelinks': 'div.osl::text'
Expand All @@ -56,7 +56,7 @@ class GoogleParser(Parser):
'snippet': 'g-inner-card::text',
'title': 'g-inner-card div._Jvo::text',
'visible_link': 'g-inner-card cite::text',
'rating': 'div.osl a:first-child::text',
'rating': 'div.osl a:first-of-type::text',
'sitelinks': 'div.osl::text'
},
'de_ip_othernews_items': {
Expand All @@ -65,7 +65,7 @@ class GoogleParser(Parser):
'snippet': 'span._dwd::text',
'title': 'a._Dk::text',
'visible_link': 'cite::text',
'rating': 'div.osl a:first-child::text',
'rating': 'div.osl a:first-of-type::text',
'sitelinks': 'div.osl::text'
},
},
Expand Down Expand Up @@ -93,9 +93,9 @@ class GoogleParser(Parser):
'us_ip': {
'container': '#center_col',
'result_container': 'li.ads-ad',
'link': 'h3.r > a:first-child::attr(href)',
'link': 'h3.r > a:first-of-type::attr(href)',
'snippet': 'div.s span.st::text',
'title': 'h3.r > a:first-child::text',
'title': 'h3.r > a:first-of-type::text',
'visible_link': '.ads-visurl cite::text',
'rating': 'div._Ond _Bu span::text',
'sitelinks': 'div.osl::text'
Expand Down

0 comments on commit 1493dc1

Please sign in to comment.