如何编写 Greasemonkey 脚本来处理 __doPostBack()
我有科学计算背景,并且确实有一些流行和不流行(临时)编程语言的历史,但我对客户端编程和 JavaScript 完全陌生。
我之前为 Greasemonkey 设置编写过一些简单的 JavaScript,但仅此而已。
我的问题涉及: http://www.ise.org/sirketler/sirketler.aspx
我正在尝试从上面的 URL 中给出的表格中获取有关证券和公司的所有数据,该 URL 是土耳其伊斯坦布尔证券交易所的网站。
该数据在根据公司名称开头的字母分类的网格表中给出,并且每个网格最多给出 10 行,如您所见。另外,在页面的右下角,写着此信息传播了多少页。
例如,您可以从 Firebug 控制台调用:
__doPostBack('ctl00$cphContent$ctl00$lbtnT','')
来获取以“T”开头的公司,并且您可以通过
__doPostBack('ctl00$cphContent$ctl00$radGridSirketler$ctl00$ctl03$ctl01$ctl05','')
__doPostBack('ctl00$cphContent$ctl00$radGridSirketler$ctl00$ctl03$ctl01$ctl07','')
__doPostBack('ctl00$cphContent$ctl00$radGridSirketler$ctl00$ctl03$ctl01$ctl09','')
分别针对该表的第一页、第二页和第三页发出:等来浏览这些表的选项卡。
我尝试通过对给定的字母和数字数组发出 __doPostBack() 方法来序列化它,方法是将它们连接到上面的固定字符串,但没有成功。
那么我如何使用 __doPostBack() 方法并附加所有这些生成的子表并获取总体数据?
是否有此类任务的资源可供阅读?
对于所有 JS 黑客提出的业余问题,我深表歉意。
I'm coming from a scientific computation background and do have some history with some popular and non-popular (ad hoc) programming languages but I'm completely alien to client side programming and JavaScript.
I've written some trivial JavaScript for my Greasemonkey settings before but that's all.
My question concerns: http://www.ise.org/sirketler/sirketler.aspx
I'm trying to get all the data about securities and companies from the table given in the URL above which is the site of Turkish İstanbul Stock Exchange.
This data is given within a grid table classified according to the letters which the name of the company begins and at a maximum of 10 rows per grid is given as one can see. Also in the bottom right of the page, there writes how many pages is this info is spread.
For example, you can call from the Firebug console:
__doPostBack('ctl00$cphContent$ctl00$lbtnT','')
for getting the companies starting with 'T' and you can browse the tabs of these table by issuing:
__doPostBack('ctl00$cphContent$ctl00$radGridSirketler$ctl00$ctl03$ctl01$ctl05','')
__doPostBack('ctl00$cphContent$ctl00$radGridSirketler$ctl00$ctl03$ctl01$ctl07','')
__doPostBack('ctl00$cphContent$ctl00$radGridSirketler$ctl00$ctl03$ctl01$ctl09','')
etc. for 1st, 2nd and 3rd pages of this table respectively.
I've tried to serialize this by issuing __doPostBack()
method for a given array of letters and numbers by concatenating them to the fixed string above but it did not succeed.
So how can I use __doPostBack()
method and append all of these resulting sub tables and get the overall data?
Is there a resource to read for such kind of tasks?
I apologize for my amateur question from all JS hackers.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
希望这个例子能启发你的道路:
Hopefully this example will enlighten your path: