Can I use Python lxml on Google App Engine? (or do I have to use Beautiful Soup?)
I have started using Beautiful Soup but it seems slow. I am just starting to play with the idea of "screen scraping" data from other websites to create some sort of "mash-up".
App Engine offers you a choice between two Python language environments.
Google App Engine provides four possible runtime environments for applications, one for each of four programming languages: Java, Python, PHP, and Go.
App Engine is part of Google Cloud Platform, a suite of services for running scalable applications, performing large amounts of computational work, and storing, using, and analyzing large amounts of data.
EDIT: The lxml
library is now supported.
Short answer: you can't.
From AppEngine's docs: "Application code written for the Python environment must be written exclusively in Python. Extensions written in the C language are not supported"
Now whether you must use BeautifulSoup or not, it really depends on how you plan to use it. Update the question with details and I'll try to update here with other suggestions, if possible.
To add to Caio's revised answer, you can use lxml
and this is how to do it:
In your app.yaml
file, add the following:
libraries:
- name: lxml
version: "2.3" # or "latest"
Now import lxml
will work in your Python script.
Here is the link to the official documentation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With