from lxml import html import requests page = requests.get('http://192.168.2.1/a200-ConnDev.htm?t=1481245759929.html') tree = html.fromstring(page.content) #This will create a list of buyers: d1 = tree.xpath('//*[@id="On1Name"]/text()') #This will create a list of prices d2 = tree.xpath('//*[@id="On2Name"]/text()') d3 = tree.xpath('//*[@id="On3Name"]/text()') d4 = tree.xpath('//*[@id="On4Name"]/text()') d5 = tree.xpath('//*[@id="On5Name"]/text()') d6 = tree.xpath('//*[@id="On6Name"]/text()') d7 = tree.xpath('//*[@id="On7Name"]/text()') d8 = tree.xpath('//*[@id="On8Name"]/text()') d9 = tree.xpath('//*[@id="On9Name"]/text()') d10 = tree.xpath('//*[@id="On10Name"]/text()') d11 = tree.xpath('//*[@id="On11Name"]/text()') d12 = tree.xpath('//*[@id="On12Name"]/text()') d13 = tree.xpath('//*[@id="On13Name"]/text()') d14 = tree.xpath('//*[@id="On14Name"]/text()') d15 = tree.xpath('//*[@id="On15Name"]/text()') d16 = tree.xpath('//*[@id="On16Name"]/text()') d17 = tree.xpath('//*[@id="On17Name"]/text()') d18 = tree.xpath('//*[@id="On18Name"]/text()') d19 = tree.xpath('//*[@id="On19Name"]/text()') print d1 print d2 print d3 print d4 print d5 print d6 print d7 print 'hello'
Run
Reset
Share
Import
Link
Embed
Language▼
English
中文
Python Fiddle
Python Cloud IDE
Follow @python_fiddle
Browser Version Not Supported
Due to Python Fiddle's reliance on advanced JavaScript techniques, older browsers might have problems running it correctly. Please download the latest version of your favourite browser.
Chrome 10+
Firefox 4+
Safari 5+
IE 10+
Let me try anyway!
url:
Go
Python Snippet
Stackoverflow Question