Skip to content

Commit

Permalink
google full update for new site
Browse files Browse the repository at this point in the history
  • Loading branch information
Yoongi Kim committed Aug 12, 2019
1 parent 392a8b4 commit ee397ba
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions collect_links.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,14 +201,15 @@ def google_full(self, keyword, add_url=""):

while True:
try:
imgs = self.browser.find_elements(By.XPATH, '//div[@class="irc_c i8187 immersive-container irc-rcd"]//img[@class="irc_mi"]')
xpath = '//div[@class="irc_c i8187 immersive-container"]//img[@class="irc_mi"]'
imgs = self.browser.find_elements(By.XPATH, xpath)

for img in imgs:
src = img.get_attribute('src')

if src not in links and src is not None:
links.append(src)
print('%d: %s'%(count, src))
print('%d: %s' % (count, src))
count += 1

except StaleElementReferenceException:
Expand Down Expand Up @@ -257,8 +258,8 @@ def naver_full(self, keyword, add_url=""):

while True:
try:
imgs = self.browser.find_elements(By.XPATH,
'//div[@class="image_viewer_wrap _sauImageViewer"]//img[@class="_image_source"]')
xpath = '//div[@class="image_viewer_wrap _sauImageViewer"]//img[@class="_image_source"]'
imgs = self.browser.find_elements(By.XPATH, xpath)

for img in imgs:
src = img.get_attribute('src')
Expand Down

0 comments on commit ee397ba

Please sign in to comment.