H
H
hardwellZero2015-05-22 16:59:50
Python
hardwellZero, 2015-05-22 16:59:50

How to get text without tag?

Good afternoon.
It is necessary to get the text from the site (parse) which does not have identification attributes.
The markup looks like this:
36be0bc354af4078bc101632535cf065.png
I already got the links to the article, now we need a title for it.
I use BS4, Python.
How can you get it?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
E
Eugene Ki, 2015-05-22
@hardwellZero

How to parse text in a div, ignoring nested tags, BeautifulSoup?

E
Elios, 2015-05-23
@strelov1

Use xpatch there it's just xpath_text('//div/text()')

A
Anton Rodionov, 2015-05-22
@Viper029

Use regular expressions

R
Roman, 2015-05-31
@skipirich

import bs4

title = '<h3 class="null" style="margin:0; padding:0;">This is a title</h3>'
soup = bs4.BeautifulSoup(title)
print soup.select('h3')[0].get_text()

So fit?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question