Posts
 
Reputation
Joined
Last Seen
Strength to Increase Rep
+0
Strength to Decrease Rep
-0
0% Quality Score
Upvotes Received
0
Posts with Upvotes
0
Upvoting Members
0
Downvotes Received
2
Posts with Downvotes
2
Downvoting Members
2
1 Commented Post
0 Endorsements
~690 People Reached
Favorite Tags
Member Avatar for luofeiyu

here is my code: import urllib import lxml.html equitydown="http://sc.hkex.com.hk/gb/www.hkex.com.hk/chi/market/sec_tradinfo/stockcode/eisdeqty_c.htm" file=urllib.urlopen(equitydown).read() root=lxml.html.document_fromstring(file') rdata = root.xpath('//tr[@class="tr_normal" and (.//img)]') for data in rdata: data.getparent().remove(data) root1=lxml.html.tostring(root) my=open('c:\\hk1.html','w') my.write(root1) my.close() when i open c:\hk1.html,comparing it with [url]http://sc.hkex.com.hk/gb/www.hkex.com.hk/chi/market/sec_tradinfo/stockcode/eisdeqty_c.htm[/url] there is a problem ,many lines in the [url]http://sc.hkex.com.hk/gb/www.hkex.com.hk/chi/market/sec_tradinfo/stockcode/eisdeqty_c.htm[/url] such as 06830 华众控股 2,000 # 06838 盈利时 2,000 …

0
51
Member Avatar for luofeiyu

there is a simple code,which can run locally ,and get three csv file in c:/ #coding:utf-8 import urllib import re import os exchange=['NASDAQ','NYSE','AMEX'] for down in exchange: myfile=open('c:/'+down,'w') url='http://www.nasdaq.com/screening/companies-by-industry.aspx?exchange='+down+'&render=download' file=urllib.urlopen(url).read() myfile.write(file) print 'ok',down myfile.close() i want to upload it onto my google app (i have one google app account)and let …

0
76
Member Avatar for luofeiyu

i have written a program in tkinter to draw stock graph,there are two strange thing i can't understand the attachment is 'AAU' data file(attachment 1).when you download it ,please save it in /tmp/AAU there is a scrolled canvas in it , 1.strang long line,please see my attachment. i have see …

0
70
Member Avatar for luofeiyu

[code] from Tkinter import * fields = 'Name', 'Job', 'Pay' def fetch(event,entries): for entry in entries: print 'Input => "%s"' % entry.get() # get text print event.widget def makeform(root, fields): entries = [] for field in fields: row = Frame(root) # make a new row lab = Label(row, width=5, text=field) …

Member Avatar for Tech B
0
236
Member Avatar for luofeiyu

1.[url]http://www.renren.com/Login.do[/url] it is ok,my code: import cookielib, urllib2, urllib cj = cookielib.CookieJar() opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj)) exheaders = [("User-Agent","Mozilla/4.0 (compatible; MSIE 7.1; Windows NT 5.1; SV1)"),] opener.addheaders=exheaders url_login = 'http://www.renren.com/Login.do' body = (('email',' '), ('password', ')) req1 = opener.open(url_login, urllib.urlencode(body)) file=open('/tmp/sample','w') file.write(req1.read()) file.close() 2.[url]https://passport.baidu.com/?login[/url] can't login,my code: import cookielib, urllib2, urllib …

-1
87
Member Avatar for luofeiyu

there is an html file [CODE]<table> <tr> <td>ok <strong>Sep 10</strong> | <a href="ttt">Oct 10</a> | <a href="kkk">Dec 10</a> <table> <tr> <td> 123 </td> <td> 567 </td> </tr> </table> </td> </tr> </table>[/CODE] when i open it with firefox,the output is : ok Sep 10 | Oct 10 | Dec 10 123 …

Member Avatar for iceandrews
-1
82
Member Avatar for luofeiyu

there is table : <table> <tr bgcolor="F3F3F3"> <td align="right" width="240" class="tickerSm">reportdate</td> <td align="right" width="65" class="tickerSm">10/31/09</td> <td align="right" width="65" class="tickerSm">10/31/08</td> <td align="right" width="65" class="tickerSm">10/31/07</td> <td align="right" width="65" class="tickerSm">10/31/06</td> <td align="right" width="65" class="tickerSm">10/31/05</td> </tr> <tr bgcolor="ffffff"> <td class="tickerSm">Cash & Equivalents</td> <td align="right" class="ticker">2,493</td> <td align="right" class="ticker">1,429</td> <td align="right" class="ticker">1,826</td> <td align="right" class="ticker">2,262</td> …

Member Avatar for hielo
0
87