S
S
shamcode2015-01-06 14:15:45
Python
shamcode, 2015-01-06 14:15:45

How to teach phantomjs and python to communicate?

There are a dozen python parsers (using grab ) that parse several sites and save it all to the database, and display the parsed content in Django. I wanted to rewrite part of the parsers to phantomjs, but ran into saving the results in the database.
I really would not want to write to the database directly from phantomjs.
How can you teach python and phantomjs to communicate with each other? For example, there is a python script that launches several phantomjs parsers, and they give it parsed content, which the script processes and puts into the database.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
M
mefisto, 2015-01-06
@mefisto

As an option, make a queue based on redis/rabbit.
And for what purpose do you want to transfer part of the parsers to the phantom?

Y
Yuri Shikanov, 2015-01-06
@dizballanze

phantompy

E
Eugene, 2015-01-06
@Jekel

You can make a "proxy" on the phantom and access it via http from python - in order to receive already assembled pages

S
Sergey, 2015-01-27
@Vnr

Selenium webdriver for PhantomJS not an option?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question