Python how to parse src and text without ID?

Good evening!

Tell me how to parse. Want to understand how to write the query for pictures and text on nnmclub.

Picture:

img class="postImg postImgAligned img-right" alt="pic" title="pic" src="s020.radikal.ru/i716/1504/b7/e429d2b86ebd.jpg"


Try this:

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)


Issues:

function post_img at 0x7f695ac77510


What is the error?

How to put description do not understand. In the description there is this which you can find. Example text on the page:

Description:
Video editing books in FB2, the program FictionBook Editor 2.6.6.
The lessons are created specifically for the theme - Creating and editing books in the format fb2
All questions and discussion point in this topic.
Upon receipt of the theme will be updated
July 8th 19 at 11:58
1 answer
July 8th 19 at 12:00
Solution
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 where???


Judging by the error it is necessary so:
print(post_img())
sorry, text_from_url - Camylle_Ondricka31 commented on July 8th 19 at 12:03
def post_img(url):
print('Sawbuck function post_img:', url, '\n')
response = requests.get(url, timeout=10)
parsed_body = html.fromstring(response.text)
text_from_url = parsed_body.xpath('//span[@alt="pic"]/img')
print(text_from_url)
post_img('nnmclub.to/forum/viewtopic.php?t=1028529') - Camylle_Ondricka31 commented on July 8th 19 at 12:06
def post_img(url):
print('Sawbuck function post_img:', url, '\n')
response = requests.get(url, timeout=10)
parsed_body = html.fromstring(response.text)
text_from_url = parsed_body.xpath('//span[@alt="pic"]/img')
print(text_from_url)
post_img('nnmclub.to/forum/viewtopic.php?t=1028529') - Camylle_Ondricka31 commented on July 8th 19 at 12:09
so issues:

Sawbuck function post_img: nnmclub.to/forum/viewtopic.php?t=1028529

[] - Camylle_Ondricka31 commented on July 8th 19 at 12:12
:
so try
def post_img(url):
 print('Sawbuck function post_img:', url, '\n')
 response = requests.get(url, timeout=10)
 parsed_body = html.fromstring(response.text)
 text_from_url = parsed_body.xpath('//span[@alt="pic"]/img/@src')
print(text_from_url.html())

post_img('nnmclub.to/forum/viewtopic.php?t=1028529')
- Kameron_Hilpert34 commented on July 8th 19 at 12:15

Find more questions by tags ProgrammingPythonParsingWeb Development