qpython-android / qpython.org

QPython contributor & sugguestion & question homepage
http://qpython.org
58 stars 11 forks source link

lxml for Qpython3 #36

Open pythonlxml opened 9 years ago

pythonlxml commented 9 years ago

i tired to pip install lxml but its giving me a error. Is there a way to install lxml on Qpython?

riverfor commented 9 years ago

It has some dependencies with c code libraries, so we need to cross-compile it,

we will try to compile it later, now can you use an alternative now ?

pythonlxml commented 9 years ago

i hope you guys can cross-compile it, it would be very helpful. i don't know of an alternative for lxml.

bartgee commented 9 years ago

I'm joining to the request. I also use lxml in my code. It would be great to have it in QPython3.

pythonlxml commented 9 years ago

any success?

riverfor commented 9 years ago

Sorry guys, I am a little busy recently,

I have compiled the lxml for QPython, you can install it though the library manage from setting page.

Can you test it and tell whether it works for you ?

pythonlxml commented 9 years ago

Thanks for the update. I was not able to run the program.

Here is an example code

from lxml import html import requests

page = requests.get('http://econpy.pythonanywhere.com/ex/001.html') tree = html.fromstring(page.text)

buyers = tree.xpath('//div[@title="buyer-name"]/text()') prices = tree.xpath('//span[@class="item-price"]/text()')

print 'Buyers: ', buyers print 'Prices: ', prices


From - http://docs.python-guide.org/en/latest/scenarios/scrape/ I am not sure if it is because of requests. I did pip install requests and it said successfully installed.

pythonlxml commented 9 years ago

any update?

riverfor commented 9 years ago

Sorry, I haven't tested your code, can you create some simple xml document for testing ?

pythonlxml commented 9 years ago

sure xml document (note.xml) http://pastebin.com/LAC3QDVE working code for python http://pastebin.com/Dxm9hRaX

pythonlxml commented 9 years ago

where you able to run it?

riverfor commented 9 years ago

I could run the following sample successfully

"xml document (note.xml) http://pastebin.com/LAC3QDVE working code for python http://pastebin.com/Dxm9hRaX "

But I couldn't run the previous sample, I have looked into this issue, maybe the lxml packages contains some wrong .so libraries, I will check that and try to fix it.

pythonlxml commented 9 years ago

thanks for the update :)

Zenadix commented 9 years ago

+1 for this. I'm using QPython3 and couldn't find lxml under Libraries manage.

nico202 commented 8 years ago

I'd need this too, anyone who cross compiled it successfully?

eoghanstafford commented 8 years ago

Joining this thread

kavuraki commented 7 years ago

I am one of those who wait. Thanks.

scott4290 commented 4 years ago

I'm able to get this working in Pydroid 3, but want to do the same in QPython since it has the capability to keep scripts running in the background. Has anyone here had any success with lxml?

ChrisYeGX commented 4 years ago

Anyone who cross compiled it successfully? It goes wrong with the etree.

Sebbb commented 3 years ago

Hello,

is there a chance to use lxml on Android?

Thanks...

skykhnz commented 6 months ago

Still not working for 10 years :-) can not pip install lxml because the qpython python version is 3.6.6 but lxml requires v>3.7. I've already tried to install every other older versions of lxml but no luck. Any help will be appreciated.