Is it possible to use Python lxml on Google App Engine?

前端 未结 2 1701
孤独总比滥情好
孤独总比滥情好 2021-02-20 03:03

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

相关标签:
2条回答
  • 2021-02-20 03:09

    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.

    0 讨论(0)
  • 2021-02-20 03:24

    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.

    0 讨论(0)
提交回复
热议问题