excel抓取网页动态数据(STM32网页分框架(): )

优采云 发布时间: 2021-11-22 07:02

  excel抓取网页动态数据(STM32网页分框架():

)

  如何抓取动态网页生成的数据?这个动态的asp网页是分帧的,点击左边网页的链接比如javascript:top.market.Openmarket(185)会在右边的frame中显示数据

  如何获取这些数据?

  Email:非常感谢!!--------------------编程问答----------------- -- -javascript:top.market.document.InnerHTML------------编程问答-------------- ---- --usingmshtml;

  ///

  ///在 Web 浏览器控件的顶级文档中返回对框架窗口的引用,并带有指定索引

  ///

  ///

  指定框架窗口索引的基于零的索引

  [CLSCompliant(false)]

  publicIHTM​​LWindow2GetFrameByIndex(intframeIndex)

  {

  IHTMLDocument2htmlDocument=(IHTMLDocument2)this.Document.DomDocument;

  returnGetFrameByIndex(frameIndex,htmlDocument);

  }

  ///

  ///ReturnsareferencetotheframewindowwithangivenindexinanHTMLdocument

  ///

  ///

  指定框架窗口索引的基于零的索引

  ///

  要搜索的 HTML 文档

  [CLSCompliant(false),ComVisible(false)]

  staticpublicIHTM​​LWindow2GetFrameByIndex(intframeIndex,IHTMLDocument2htmlDocument)

  {

  if(htmlDocument==null)

  returnnull;

  objectoIndex=frameIndex;

  objectoFrame=htmlDocument.frames.item(refoIndex);

  if(oFrame==null)returnnull;

  返回(IHTMLWindow2)oFrame;

  }--------------------编程问答--------------------点击这个javascript: top.market.Openmarket(185)会去链接……/…….asp?185,然后这个数据怎么抓取保存呢?还有180165号不固定,每更新一次天,我怎么能每天自动分析这个数字,然后抓取这些页面上的数据并保存?--------------------编程问答---------- ----------up------------编程问答------- ---------- ---我一直在用HttpWebRequest--------------------编程问答--------- ----------II 也用这个,但是对于这个网站 好像不能单独用httpwebrequest 检索数据---------------- ----编程问答--------- -------------阅读C#中的javascript代码并重写函数。------------编程Q&A ------------ --------functionDisplaynums(numsSource,VolumeSource){

  varnums=document.getElementsByName('nums');

  varVolume=document.getElementsByName('Volume');

  if(numsSource.length==nums.length){

  for(i=0;i

  if(numsSource[i]=='0'){

  nums[i].innerHTML='';//! ! !这里的 nums[i] 是我想要获取的数据

  Volume[i].innerHTML='';}

  其他{

  /*

  //更改市场颜色

  if(nums[i].innerHTML!=``&&Volume[i].innerHTML!=''&&(nums[i].innerHTML!=numsSource[i]||Volume[i].innerHTML!=VolumeSource [i])){

  nums[i].style.color='#FFFFFF';

  音量[i].style.color='#FFFFFF';

  }

  */

  nums[i].innerHTML=numsSource[i];

  Volume[i].innerHTML=VolumeSource[i];

  }

  }

  }

  其他{

  window.location.reload();

  }

  }

  我读了这段代码。我想获取 nums[i] 的数据。我如何获得这些数据?非常感谢兄弟~! --------------------编程问答 --------------------以上是错误的,应该是numsSource [i] 是我需要的数据。 --------------------编程问答--------------------江城高手请帮忙,如何?在client端调用server端的java函数,实在想不出办法-------------------- 编程问答---- ------- -------调用相同的DOM方法

  HtmlWindowPopupOptionWindow()

  {

  IHTMLAnchorElementae=extendedWebBrowser1.GetLinkByHref("popupEligiNewRT");

  if(ae!=null)

  {

  Debug.WriteLine(ae.href);

  //javascript:popupEligiNewRT('DIANA%20JOHN%20W',%20'SUB','form0')

  //functionpopupEligiNewRT(name,opt,form){

  //varstr="eligipopup.jsp?&name="+name+"&opt="+opt+"&form="+form;

  //window.open(str,'popupeligiwin','width=600,height=375,left=250,top=100,menubar=yes,status=yes,toolbar=no');

  //}

  stringhref=ae.href;

  href=href.Substring(

  href.IndexOf("("));

  Stringdelim="()";

  href=href.Trim(delim.ToCharArray());

  string[]parameters=href.Split(",".ToCharArray());

  delim="'";

  stringname=parameters[0].Trim(delim.ToCharArray());

  stringopt=parameters[1].Trim(delim.ToCharArray());

  stringform=parameters[2].Trim(delim.ToCharArray());

  stringPopupURL=string.Format("{0}&opt={1}&form={2}",name,opt,form);

  returnextendedWebBrowser1.Document.Window.Open(PopupURL,"autopopupeligiwin","width=600,height=375,left=250,top=100,menubar=yes,status=yes,toolbar=no" ,假);

  }

  returnnull;

  }

  补充:.NET技术 , C#

0 个评论

要回复文章请先登录注册


官方客服QQ群

微信人工客服

QQ人工客服


线