In special cases, we can't use Twebbrowser to analyze the source code, so how do we extract the links and text we need from the string? Here are some of the ways I look at the network.
Get site Links: (This method gets the link is not an absolute link, you need to write a replacement)
procedureTform1.button1click (sender:tobject);varDoc:ihtmldocument2; Ln:ihtmlanchorelement; I:integer; Vhtml:olevariant;beginDoc:=cohtmldocument.create asIHTMLDocument2; Doc.designmode:=' on'; Doc.charset:='UTF-8'; VHTML:= Vararraycreate ([0,0], varvariant); vhtml[0]: = Strs.text;//here Strs.text is the code of a page I have made in advanceDoc. Write (Psafearray (Tvardata (VHTML). Varray)); fori:=0 todoc.links.length-1 Do begin ifSUCCEEDED (Doc.links.item (i,0). QueryInterface (IHTMLAnchorElement, LN)) ThenMemo2. Lines.add (LN.HREF); End; Doc.close; Doc:=Nil;End;
String Analysis Web Source