Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e938331

Browse files
committed
better regex used avoiding garbage google images
1 parent d20b99e commit e938331

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/utils/google.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def __parsePage(self, page):
5454

5555
matches = []
5656

57-
regExpr = "class=\042?r\042?\076\074a href=\042(http[s]*://.+?)\042\sclass=\042?l\042?"
57+
regExpr = "li class=\042?g\042?\076.+?a href=\042(http[s]*://.+?)\042\sclass=\042?l\042?"
5858
matches = re.findall(regExpr, page, re.I | re.M)
5959

6060
return matches

0 commit comments

Comments
 (0)