# This is a sample Python script.
# Press Shift+F10 to execute it or replace it with your code.
# Press Double Shift to search everywhere for classes, files, tool windows, actions, and settings.
import requests;
from bs4 import BeautifulSoup
# while True:
# url = 'https://vk.com/resunkii'
# page = requests.get(url)
#
# soup = BeautifulSoup(page.text, "html.parser")
#
# print(soup.find(class_="pm_counter").get_text())
# page.close()
findAllCount = 0;
while True:
url = 'https://vk.com/hoynia'
page = requests.get(url)
soup = BeautifulSoup(page.text, "html.parser")
findAlls = soup.findAll(class_="pi_text")
lenFind = len(findAlls)
alph = ["Doge", "Coin", "coin", "Bitcoin"]
if findAllCount < lenFind:
for data in findAlls:
print(data.text)
for i in range(0, len(alph), 2):
if alph[i] in data.text:
print(1)
f2 = open("C:/Users/admin/Desktop/ParseTest/text2.txt", 'w')
findAllCount = lenFind
url = 'https://twitter.com/?lang=ru'
page = requests.get(url)
soup = BeautifulSoup(page.text, "html.parser")
print(soup)