Git Product home page Git Product logo

Comments (3)

Antar1011 avatar Antar1011 commented on August 23, 2024

Okay, so the alternative topy_mini_racer or js2py is to actually just use node.

As a POC, create a file called blah.js which has the following contents:

console.log('Hello World')

Then from the terminal, with node installed, you can run

$ node blah.js
Hello World

So how this would work is that one would have python download the js to be scraped, prepend exports={}, append console.log(JSON.stringify(exports.BattlePokedex) (or whatever), and then use os.system to run node and capture the output. I'm willing to bet with some research I can figure out how to get node to run piped input instead of needing to execute a file.

Note that conda can install node just as easily as pip can install py_mini_racer. Of course, conda doesn't work with pypy, but as long as my environment in TravisCI has node, this shouldn't be a problem--I'll just need to specify somewhere that node is needed to run Onix.

from onix.

Antar1011 avatar Antar1011 commented on August 23, 2024

Fine for now, since we're not worrying about PyPy compatibility

from onix.

Antar1011 avatar Antar1011 commented on August 23, 2024

Yeah, building py_mini_racer is nontrivial. Integrating with Travis (see: #40) required that we use a special environment (Ubuntu 14.04 rather than the standard 12.04), and then the only environments I've found where it'll build successfully are 3.5 and 2.7.

That's fine for now, since those are the two environments I'm targeting (and I'm not planning on deploying Onix anywhere that's running an Ubuntu older than 14.04), but this is actually a serious hindrance.

from onix.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.