lundi 24 septembre 2018

BeautifulSoup export

I am running the code below and getting an output that looks like the following

class="widget" id="dnf_class_values_procurement_notice__classification_code__widget">\n\tR -- Professional, administrative, and management support services\n\t\t

all I want is Professional, administrative, and management support services

How can I get rid of all the other text included in the output? I am using BeautifulSoup in Python

i = "https://www.fbo.gov/index.php?s=opportunity&mode=form&id=50e3e1ec75e2aaa7c4fca7761e4c46a2&tab=core&_cview=1"
response = requests.get(i)
textfield = response.text
soup = BeautifulSoup(textfield, 'lxml')
tags = soup.find_all(attrs={'id':'dnf_class_values_procurement_notice__classification_code__widget'})
tags




Aucun commentaire:

Enregistrer un commentaire