from parser_class import Parser MY_PARSER = Parser() file_name = input('File name : ') MY_PARSER.parse(in_file_dir=file_name)
from parser_class import Parser import re import time import Trip_news_data as tnd from bs4 import BeautifulSoup import requests parser1 = Parser('https://triptodream.ru/', 'newsTtD.txt', tnd.data[1], False) reads1 = parser1.run() news_actual = reads1[::] print(reads1[0]) print(news_actual[0])
def __init__(self): self.parser = Parser()
from parser_class import Parser parser = Parser('https://quote.rbc.ru/?utm_source=topline', 'rbk_news.txt') parser.run()
from parser_class import Parser parser = Parser('https://leninsk-kuz.ru/news/', 'new_news.txt') parser.run()
from parser_class import Parser import re import time import Trip_news_data as tnd from bs4 import BeautifulSoup import requests parser = Parser('https://vandrouki.ru/', 'newsVD.txt', tnd.data[0], False) # url = 'https://vandrouki.ru/' # print(parser.site['data'][0][0], parser.site['data'][0][1]) # results = [] # raw_html = requests.get(url) # html = BeautifulSoup(raw_html.text, 'html.parser') # news = html.find_all(parser.site['data'][0][0], parser.site['data'][0][1]) # # print(news) # for item in news: # title = item.find(parser.site['data'][1][0], # parser.site['data'][1][1]).get_text(strip=True) # results.append({ # 'title': title, # }) # print(results) reads = parser.run() news_actual = reads[::] print(reads[0]) print(news_actual[0]) while True:
from parser_class import Parser parser = Parser('https://www.ua-football.com/ua/sport', 'news.txt') parser.run() print(Parser.results)