K
K
King_Of_Magic2013-01-23 18:27:09
Perl
King_Of_Magic, 2013-01-23 18:27:09

Python vs Perl

Task: you need to write a parser for a large number of completely different sites, do a lot of manipulations with them (string functions - search, replace, combine several records in an array into one) and save the result in MySQL. Now this is done in PHP using the phpQuery library, but this option is not very convenient, so I want to rewrite everything in Python or Perl, so there are two questions:

1) Which is better to choose (simpler, faster, more powerful)?

2) How to run this business under Windows, preferably on Vertrigo.

Regarding the purpose of the parser: I’ll say right away that this is not content theft, it performs large volumes of information processing automation, which I will write a post about when I have enough karma.

Answer the question

In order to leave comments, you need to log in

6 answer(s)
V
Vyacheslav Golovanov, 2013-01-24
@SLY_G

The good news about perl is that once you learn it, you can do many things in many ways , you can join the order of perl monks , learn to use florid language on a regular basis , and girls will gasp with delight when they find out that you are a perl perl.
I lied about the last one.

W
Weageoo, 2013-01-24
@Weageoo

Python + Scrapy
In pipelines.py in def open_spider(self, spider) we open a connection to the base, in def close_spider(self, spider) we close it.
Each site has its own spider (class in .py file). The system is thoughtful, you can deploy the results of parsing even as a web service using built-in tools.

S
shadowjack, 2013-01-27
@shadowjack

Only Perl, only hardcore!

C
Chips, 2013-01-23
@Chips

If you do not know either python or pearl, then it does not matter. For both languages ​​there is a rather large community and a lot of information on the Internet on any issue.
Under WIndows, both languages ​​have compilers/interpreters. Pearl even has a few.

R
ragus, 2013-05-29
@ragus

get python. especially since now it has accelerated quite well, thanks to pypy.

K
kuznetsovin, 2013-12-03
@kuznetsovin

python + lxml helped me to cope with a similar task

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question