Jump to content
Guest

Anime-uri postate

Recommended Posts

:)

python 2.7

http://pastebin.com/QMjrJdpV

sau

#url = "http://deseneanime.ro/category/anime"
import argparse
from bs4 import BeautifulSoup
import requests
import codecs
import sys
import time
import re
url = ('http://deseneanime.ro/category/anime')
r  = requests.get(url)
data = r.text
soup = BeautifulSoup(data, 'lxml')
mydivs = soup.findAll("div", { "class" : "ui episode list" }) #cauta pentru classa ui episode list
x = codecs.open("wow.txt", "w", "utf-8") #deschide wow.txt
for link in mydivs:
	x.write(link.find('a')['href'] + " " + link.find('a').contents[2].string +"\r\n") #scrie toate link-urile din classa ui epsidoe list + data in care au fost postate
pukat = time.strftime("%d") #data de astazi
def check_string():
	w = pukat
	with open("wow.txt") as f:
		found = False
		for line in f:
			if w in line:
				print line
				found = True # ca sa nu printeze ----- la fiecare link care nu e bun
				time.sleep(1)
			if not found:
				print "-------"
check_string()
time.sleep(5)
sys.exit()

Salveaza intr-un txt toate link-urile de la anime-urile postate+ data si printeaza pe cele postate astazi

 

+ http://pastebin.com/W2DwUJ3F

aici zici tu cate anime-uri sa printeze din wow.txt

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...