Existing user? Sign in
Sign up
Games
Servers
Useful
User
Pass
2FA
[Python] Ajutor Scrapy !
Freakz Forum Index
->
Trash Bin
->
Trash
->
Programming / Scripting / Database
Author
Message
1090
icezone
[Mentally Stable]
Status: Offline
(since 13-04-2020 17:12)
Joined: 31 Jul 2009
Posts: 59
,
Topics: 23
Location:
C:\windows\HERE
Reputation:
239.4
Votes
: 8
Posted: 24-07-2016, 08:13:03
| Translate post to:
... (
Click for more languages
)
Salut ! Nu am mai facut un post de mult ....
Acum cateva ore cautam un program care scaneaza siteurile si fura continul ,si am gasit acest Scrapy folosit prin Python.
NU stiu nimic in acest program , si as vrea putin ajutor !
As dorii putin ajutor la un script ...
Code:
# -*- coding: utf-8 -*-
import scrapy
from scrapy.spiders import CrawlSpider, Rule
from scrapy.linkextractors import LinkExtractor
from lxml import html
class Scrapy1Spider(CrawlSpider):
name = "craiglist"
allowed_domains = ["sfbay.craigslist.org"]
start_urls = (
'http://sfbay.craigslist.org/search/npo',
)
rules = (Rule(LinkExtractor(allow=(), restrict_xpaths=('//a[@class="button next"]',)), callback="parse_page", follow= True),)
def parse_page(self, response):
site = html.fromstring(response.body_as_unicode())
titles = site.xpath('//div[@class="content"]/p[@class="row"]')
print len(titles), 'AAAA'
Acum as putea face ca acest script , sa citeasca pagina , sa intre intr-un post , sa se intoarca si sa citeasca alt post ?
Multumesc !
hast
0
0
Back to top
Freakz Forum Index
->
Trash Bin
->
Trash
->
Programming / Scripting / Database
The time now is 07-02-2025, 06:18:16
Copyright info
Based on phpBB
ro
/
com
B
Login
I forgot my password
World of Warcraft
Login for more...
Download WoW 7.3.5
Misc
eSports
Achievements
Buy reputation with votes
Reputation trades
Forum rules
Ban list
Members list
User guide (FAQ)
World of Warcraft
View details