PEP8 Correction

This commit is contained in:
Vansh Comar 2021-10-19 00:07:43 +05:30
parent 08d2074697
commit 6ea18a4b59

View File

@ -254,17 +254,18 @@ def search():
# Feature to display IP address
html_soup = bsoup(response, 'html.parser')
if(not html_soup.select_one(".EY24We")
if(not html_soup.select_one(".EY24We")
and html_soup.select_one(".OXXup").get_text().lower() == "all"):
if re.search("([^a-z0-9]|^)my *[^a-z0-9] *(ip|internet protocol)" +
"($|( *[^a-z0-9] *(((addres|address|adres|adress)|a)? *$)))", query.lower()):
"($|( *[^a-z0-9] *(((addres|address|adres|adress)|a)?"+
" *$)))", query.lower()):
# HTML IP card tag
ip_tag = html_soup.new_tag("div")
ip_tag["class"] = "ZINbbc xpd O9g5cc uUPGi"
# What is my IP tag
q_tag=html_soup.new_tag("div")
q_tag = html_soup.new_tag("div")
q_tag["class"] = "kCrYT"
q_tag.string = "What's my IP"
@ -291,8 +292,8 @@ def search():
ip_tag.append(ip_text)
# Finding the element before which the IP card would be placed
first_link_in_results = html_soup.select_one(".BNeawe.vvjwJb.AP7Wnd")
ref_element = first_link_in_results.find_parent(class_ = "ZINbbc xpd O9g5cc uUPGi")
f_link = html_soup.select_one(".BNeawe.vvjwJb.AP7Wnd")
ref_element = first_link.find_parent(class_="ZINbbc xpd O9g5cc uUPGi")
# Inserting the element
ref_element.insert_before(ip_tag)