Questions tagged as 'beautifulsoup'

1
answer

bs4: How to wrap an incomplete html code?

Hello, I came across incomplete html codes where the "html" and "body" tags are missing. Here is the code I've implemented: import bs4 content=''' <head> <title> my page </title> </head> <table border="0" c...
asked by 19.06.2018 / 15:47
1
answer

Beautiful Soup - Remove a tag while keeping Text

I have the following tags: <p>Projeto N <sup>o</sup> 00.000, DE 00 DE JANEIRO DE 0000.</p> I would like to remove the tag by keeping the text. I needed it to look like this: <p>Projeto N o 00.000, DE 00 DE...
asked by 28.11.2018 / 16:24
0
answers

Multiple search engines in a html file with variable parameters

Good morning everyone. Need to search for the name of the presidents of Brazil, in html files. I created a json with the names of the presidents to facilitate. Follow the code: # !/bin/env python # coding: utf-8 __author__ = '@britodfb...
asked by 26.06.2018 / 16:42
3
answers

Remove comment tag and its contents in Beautifulsoup 4

How do I remove the comment tag along with its contents with bs4? <div class="foo"> A Arara é um animal voador. <!-- <p>Animais Nome: Arara Idade: 12 anos e 9 meses Tempo de Vida: 15 anos --> </div>     
asked by 27.12.2018 / 17:56
2
answers

Questions about the use of BeautifulSoup

My code below is to get the genre of movies from the IMDB site, however I'm not sure how to get the specific tag of genres from the site, because sometimes instead of catching the genre it gets the keywords tag, get the first div he think...
asked by 26.11.2018 / 01:53
1
answer

Scraping data using Robobrowser

I'm trying to scrape a form, to insert an attachment and send, using Robobrowser. To open the page I do: browser.open('url') To get the form I do: form = browser.get_form(id='id_form') To insert the data into the form I do: form['...
asked by 12.12.2018 / 16:40
1
answer

Requests, BeautifulSoup Tables

I have a website that I want to extract specific data from a table Iwanttoextractalltheinformationthathas"PROLONG" element. My difficulty is that all tables have the same name in the "class" class="field". how do I extract the data related t...
asked by 10.05.2018 / 01:21
2
answers

How to create the tag! DOCTYPE html in Beautiful Soup (bs4)

I wanted to create the Beautiful Soup tag (bs4), and I developed the following: from bs4 import Doctype tag = Doctype('html') I did the above. But it does not create the tag. How to proceed?     
asked by 09.05.2018 / 16:30
1
answer

Doubt how to shave data like Python using BeautifulSoup Table

I'm a beginner and I'm trying to get a table from the transparency portal site, but I'm not able to get the tag with no data at all. When I open the developer tool I visualize the data that I want the states and the transfer value to be, but w...
asked by 10.11.2018 / 10:18
1
answer

How to avoid error Max retries exceeded in scraping in Python?

In Python 3 I made a program to wipe table rows from a multipage public site (97893). And I create a list with the rows of each column and I put sleep to try to avoid that the scraping stops, but even using several times is not working...
asked by 19.01.2018 / 12:41