remove unnecessary parts
This commit is contained in:
parent
a4c576ef33
commit
f663d0934f
|
@ -397,11 +397,8 @@ class Filter:
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# get some tags that are unchanged between mobile and pc versions
|
# get some tags that are unchanged between mobile and pc versions
|
||||||
search_input = soup.find_all('td', attrs={'class': "O4cRJf"})[0]
|
|
||||||
search_options = soup.find_all('div', attrs={'class': "M7pB2"})[0]
|
|
||||||
cor_suggested = soup.find_all('table', attrs={'class': "By0U9"})
|
cor_suggested = soup.find_all('table', attrs={'class': "By0U9"})
|
||||||
next_pages = soup.find_all('table', attrs={'class': "uZgmoc"})[0]
|
next_pages = soup.find_all('table', attrs={'class': "uZgmoc"})[0]
|
||||||
information = soup.find_all('div', attrs={'class': "TuS8Ad"})[0]
|
|
||||||
|
|
||||||
results = []
|
results = []
|
||||||
# find results div
|
# find results div
|
||||||
|
@ -434,12 +431,7 @@ class Filter:
|
||||||
results=results,
|
results=results,
|
||||||
view_label="View Image"),
|
view_label="View Image"),
|
||||||
features='html.parser')
|
features='html.parser')
|
||||||
# replace search input object
|
|
||||||
soup.find_all('td',
|
|
||||||
attrs={'class': "O4cRJf"})[0].replaceWith(search_input)
|
|
||||||
# replace search options object (All, Images, Videos, etc.)
|
|
||||||
soup.find_all('div',
|
|
||||||
attrs={'class': "M7pB2"})[0].replaceWith(search_options)
|
|
||||||
# replace correction suggested by google object if exists
|
# replace correction suggested by google object if exists
|
||||||
if len(cor_suggested):
|
if len(cor_suggested):
|
||||||
soup.find_all(
|
soup.find_all(
|
||||||
|
@ -449,7 +441,4 @@ class Filter:
|
||||||
# replace next page object at the bottom of the page
|
# replace next page object at the bottom of the page
|
||||||
soup.find_all('table',
|
soup.find_all('table',
|
||||||
attrs={'class': "uZgmoc"})[0].replaceWith(next_pages)
|
attrs={'class': "uZgmoc"})[0].replaceWith(next_pages)
|
||||||
# replace information about user connection at the bottom of the page
|
|
||||||
soup.find_all('div',
|
|
||||||
attrs={'class': "TuS8Ad"})[0].replaceWith(information)
|
|
||||||
return soup
|
return soup
|
||||||
|
|
Loading…
Reference in New Issue
Block a user