예제 #1
0
from parser_class import Parser

parser = Parser('https://quote.rbc.ru/?utm_source=topline', 'rbk_news.txt')
parser.run()
예제 #2
0
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])
예제 #3
0
# 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:

    # word = 'Москва?'

    # for i in reads:
    #     if re.search(word, i['title']):
    #         print(i)
    # if len(news_actual) == 0:
    #     news_actual.append(reads[0])
    #     print(1, news_actual)
    # if reads[0] == news_actual[0]:
    #     print('равны')