Here is a parser
import requests
Import DateParser.
From BS4 Import Beautifulsoup
Import mysql.connector
DEF Get_HTML (URL):
R = Requests.get (URL)
Return R.Text
DEF Get_Data (HTML):
Soup = Beautifulsoup (HTML, 'LXML')
title = Soup.find ('H1'). Text
Date = Soup.find ('Span', {'Class': 'NEWS_DATE'}). Text
Text = Soup.find ('p'). Text
Textp = Soup.find_all ('P')
dateparser.parse ('30 July 2019, 13:48 ', Date_formats = ['% d% B% y% h '])
Print (Title)
PRINT (DATE)
PRINT (text)
Print (Textp)
DEF Main ():
url = 'https://www.zakon.kz/4979616-kazahstan-spustya-12-let-vyigral-zoloto.html'
(Get_Data (Get_HTML (URL)))
if __name__ == '__main__':
Main ()
and when it is out of the parser of these rows, these data are an array. How do I convert them to a string?
textp = soup.find_all ('p')
Print (Textp)
Answer 1, Authority 100%
a = ['a', 'b', 'c']
STR_A = '' .JOIN (A) # 'ABC'
Answer 2, Authority 25%
Found Answer: When Print used the Join Print method