Answer the question
In order to leave comments, you need to log in
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
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.
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.
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.
get python. especially since now it has accelerated quite well, thanks to pypy.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question