Skip to content

Commit 8bee646

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 51d1c78 commit 8bee646

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

web_programming/open_google_results.py

+2-10
Original file line numberDiff line numberDiff line change
@@ -30,19 +30,11 @@
3030
print(BeautifulSoup(res.text, "html.parser"))
3131

3232
try:
33-
link = (
34-
BeautifulSoup(res.text, "html.parser")
35-
.find("div")
36-
.find("a")
37-
.get("href")
38-
)
33+
link = BeautifulSoup(res.text, "html.parser").find("div").find("a").get("href")
3934

4035
except AttributeError:
4136
link = parse_qs(
42-
BeautifulSoup(res.text, "html.parser")
43-
.find("div")
44-
.find("a")
45-
.get("href")
37+
BeautifulSoup(res.text, "html.parser").find("div").find("a").get("href")
4638
)["url"][0]
4739

4840
webbrowser.open(link)

0 commit comments

Comments
 (0)