CindyDelage commited on
Commit
d64f472
·
verified ·
1 Parent(s): 2b14047

Update tools.py

Browse files
Files changed (1) hide show
  1. tools.py +8 -7
tools.py CHANGED
@@ -181,7 +181,7 @@ class audio_or_mp3__interpreter(Tool):
181
 
182
  class Wikipedia_reader(Tool):
183
  name="wiki_tool"
184
- description = "To be used whenever you need to read a Wikipedia page. Will return all the html code of the Wikipedia page, to easily read it and find information. IF you need numeric information and can not easily have it with this function, use html_tool"
185
  inputs = {
186
  "url": {
187
  "type": "string",
@@ -191,12 +191,13 @@ class Wikipedia_reader(Tool):
191
  output_type = "string"
192
 
193
  def forward(self, url: str):
194
- try:
195
- page = requests.get({url})
196
- except Exception as e:
197
- print('Error downloading page: ',e)
198
- soup = BeautifulSoup(page.text, 'html.parser')
199
- return soup
 
200
 
201
  class HTML_find(Tool):
202
  name="html_tool"
 
181
 
182
  class Wikipedia_reader(Tool):
183
  name="wiki_tool"
184
+ description = "To be used whenever you need to read a Wikipedia page. Will return all wikitables, to easily read it and find information"
185
  inputs = {
186
  "url": {
187
  "type": "string",
 
191
  output_type = "string"
192
 
193
  def forward(self, url: str):
194
+ #try:
195
+ # page = requests.get({url})
196
+ #except Exception as e:
197
+ # print('Error downloading page: ',e)
198
+ #soup = BeautifulSoup(page.text, 'html.parser')
199
+ tables=pd.read_html(url)
200
+ return tables
201
 
202
  class HTML_find(Tool):
203
  name="html_tool"