Skip to content

Commit af89634

Browse files
updated techCrunch.py
1 parent 369dcbe commit af89634

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

TechCrunch-Scraper/techCrunch.py

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

1717
def getArticles(self, category):
18-
self.category = category
18+
1919
"""
2020
Class - `TechCrunch`
2121
Example:
@@ -34,7 +34,7 @@ def getArticles(self, category):
3434
}
3535
"""
3636
url = (
37-
"https://techcrunch.com/category/" + self.category.replace(" ", "-").lower()
37+
"https://techcrunch.com/category/" + category.replace(" ", "-").lower()
3838
)
3939
try:
4040
res = requests.get(url)
@@ -100,7 +100,7 @@ def getArticles(self, category):
100100
return ejson
101101

102102
def search(self, topic):
103-
self.topic = topic
103+
104104
"""
105105
Class - `TechCrunch`
106106
Example:
@@ -118,7 +118,7 @@ def search(self, topic):
118118
"link": Link to the article
119119
}
120120
"""
121-
url = "https://search.techcrunch.com/search?p=" + self.topic + "&fr=techcrunch"
121+
url = "https://search.techcrunch.com/search?p=" + topic + "&fr=techcrunch"
122122
try:
123123
res = requests.get(url)
124124
soup = BeautifulSoup(res.text, "html.parser")

0 commit comments

Comments
 (0)