【发布时间】:2018-06-13 12:37:58
【问题描述】:
然后找出“PUTS”下的最大“OI”,最后在该行中找到该特定最大OI的相应条目
直到打印行:
import urllib2
from urllib2 import urlopen
import bs4 as bs
url = 'https://www.nseindia.com/live_market/dynaContent/live_watch/option_chain/optionKeys.jsp?symbolCode=-9999&symbol=BANKNIFTY&symbol=BANKNIFTY&instrument=OPTIDX&date=-&segmentLink=17&segmentLink=17'
html = urllib2.urlopen(url).read()
soup = bs.BeautifulSoup(html,'lxml')
table = soup.find('div',id='octable')
rows = table.find_all('tr')
for row in rows:
print row.text
【问题讨论】:
-
如果您要将其标记为 python 问题,是否要添加 python 代码?
-
如果你愿意,那就去做吧 :) 这里是如何提问:stackoverflow.com/help/how-to-ask
-
@Drako 感谢您的链接,下次会记住并编辑问题。
-
@cricket_007add the code..can't move forward with find maximum and below
标签: python web-scraping