Skip to content

Commit 26172d2

Browse files
Merge pull request #2701 from avinashkranjan/deepsource-transform-6e341d0b
format code with autopep8
2 parents f44d2fd + ef99a27 commit 26172d2

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

TechCrunch-Scraper/techCrunch.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ class TechCrunch:
1515
"""
1616

1717
def get_articles(self, category):
18-
1918
"""
2019
Class - `TechCrunch`
2120
Example:
@@ -34,7 +33,8 @@ def get_articles(self, category):
3433
}
3534
"""
3635
url = (
37-
"https://techcrunch.com/category/" + category.replace(" ", "-").lower()
36+
"https://techcrunch.com/category/" +
37+
category.replace(" ", "-").lower()
3838
)
3939
try:
4040
res = requests.get(url)
@@ -78,7 +78,8 @@ def get_articles(self, category):
7878
.encode("ascii", "ignore")
7979
.decode()
8080
)
81-
links = n.find_all("a", class_="post-block__title__link", href=True)
81+
links = n.find_all(
82+
"a", class_="post-block__title__link", href=True)
8283
link = links[0]["href"]
8384
articles_data["articles"].append(
8485
{
@@ -100,7 +101,6 @@ def get_articles(self, category):
100101
return ejson
101102

102103
def search(self, topic):
103-
104104
"""
105105
Class - `TechCrunch`
106106
Example:
@@ -125,11 +125,13 @@ def search(self, topic):
125125

126126
articles_data = {"articles": []}
127127

128-
articles = soup.find_all("li", class_="ov-a mt-0 pt-26 pb-26 bt-dbdbdb")
128+
articles = soup.find_all(
129+
"li", class_="ov-a mt-0 pt-26 pb-26 bt-dbdbdb")
129130
for i in articles:
130131
name = i.find("a", class_="fz-20 lh-22 fw-b").getText()
131132
desc = i.find("p", class_="fz-14 lh-20 c-777").getText()
132-
img = i.find("img", class_="s-img mr-10 s-img-errchk", src=True)
133+
img = i.find(
134+
"img", class_="s-img mr-10 s-img-errchk", src=True)
133135
image = img["src"]
134136
author = i.find("span", class_="mr-15").getText()
135137
date = i.find("span", class_="pl-15 bl-1-666").getText()

0 commit comments

Comments
 (0)