Answer the question
In order to leave comments, you need to log in
Python how to properly parse src and text without id?
Good evening!
Tell me how to parse correctly. I want to understand how to correctly write a request for a picture and text on nnmclub.
Picture:
img class="postImg postImgAligned img-right" alt="pic" title="pic" src=" s020.radikal.ru/i716/1504/b7/e429d2b86ebd.jpg "
response = requests.get(' nnmclub.to/forum/viewtopic.php?t=474369 ', timeout=10)
parsed_body = html.fromstring(response.text)
text_from_url = parsed_body.xpath('//span[@alt= "pic"]/img[@src]/text()')
print(post_img)
function post_img at 0x7f695ac77510
Description:
Video on editing a book in FB2, in FictionBook Editor 2.6.6.
Lessons are created specifically for the topic - Creating and editing books in fb2 format Send
all questions and discussions to this topic.
The topic will be updated as lessons are received.
Answer the question
In order to leave comments, you need to log in
response = requests.get('nnmclub.to/forum/viewtopic.php?t=474369', timeout=10)
parsed_body = html.fromstring(response.text)
text_from_url = parsed_body.xpath('//span[@alt="pic"]/img[@src]/text()')
print(post_img) # post_img откуда???
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question