I'm trying to get the href of a button using the control Web Browser. The html is:
The code I'm trying inside the event Document Completed of the Web Browser control is:HTML Code:<a download="" href="https://x638jxfnvmcxbaxcskqsdadskdqnfwexc.shikisha.shiksha/f2xcqrz1wxf13dssdalkgrdjkgdklfjdsaklkcxmsacxzcdfsvsdcqwdjkkvfmdskicmsdascmamzcassmdamcxscxzcsacasvfdssacxzcsdxvsaqswcxzvbededvvb.php?nqusjmslpeprtmdsjkhghewojicwe0guhifkjbh2qqqhstexrsfiwhvfmmoorewioujgbhuiovshdkjwvcjhfdbwehjkvkjhsdnvmwouipfdwxjwsfiwhvfhlmj=yyhnlsoahifiztdsjkhghewojicwe0guhifkjbh2qqqhscscvsfiwhvffbbsrewioujgbhuiovshdkjwvcjhfdbwehjkvkjhsdnvmwouipfdryansfiwhvfmwdn222811prciwnbztwy5&pxhotisnweqwlkdsjkhghewojicwe0guhifkjbh2qqqhsotjpsfiwhvfnshnrewioujgbhuiovshdkjwvcjhfdbwehjkvkjhsdnvmwouipfdnpsesfiwhvfoczq=yloyeevwdfcbpkdsjkhghewojicwe0guhifkjbh2qqqhszjdssfiwhvfeyczrewioujgbhuiovshdkjwvcjhfdbwehjkvkjhsdnvmwouipfdozixsfiwhvfhcimfslzpcikfrvnqldsjkhghewojicwe0guhifkjbh2qqqhsptjesfiwhvfmzsrrewioujgbhuiovshdkjwvcjhfdbwehjkvkjhsdnvmwouipfdyskesfiwhvfcchh&fkdsadxcwaqcscasxcsacxsaxazxcvsdvdslssafdsvx=174147325&dkjfsjksdadsdvcxxcvswscxrewsdf=sdx2&sdwreggllslsdxvc&sadklxcklkvb=qwrdcbkklsdxk&jiijlks=lz9fSJUhlRoBL8M8qh4Ido&uijdsdkdfkgfdsd=85652262237b1335ca34.14415852&lkfdsfxc=lz9fSJUhlRoBL8M8qh4Ido&nqusjmslpeprtmdsjkhghewojicwe0guhifkjbh2qqqhstexrsfiwhvfmmoorewioujgbhuiovshdkjwvcjhfdbwehjkvkjhsdnvmwouipfdwxjwsfiwhvfhlmj=yyhnlsoahifiztdsjkhghewojicwe0guhifkjbh2qqqhscscvsfiwhvffbbsrewioujgbhuiovshdkjwvcjhfdbwehjkvkjhsdnvmwouipfdryansfiwhvfmwdn222811prciwnbztwy5&pxhotisnweqwlkdsjkhghewojicwe0guhifkjbh2qqqhsotjpsfiwhvfnshnrewioujgbhuiovshdkjwvcjhfdbwehjkvkjhsdnvmwouipfdnpsesfiwhvfoczq=yloyeevwdfcbpkdsjkhghewojicwe0guhifkjbh2qqqhszjdssfiwhvfeyczrewioujgbhuiovshdkjwvcjhfdbwehjkvkjhsdnvmwouipfdozixsfiwhvfhcimfslzpcikfrvnqldsjkhghewojicwe0guhifkjbh2qqqhsptjesfiwhvfmzsrrewioujgbhuiovshdkjwvcjhfdbwehjkvkjhsdnvmwouipfdyskesfiwhvfcchh"><button id="myImageId44" type="button" class="download2 download2dahover"><font color="#F08080">Download MP3 (Bitrate: 320 kbps | 7.28 MB | 00:03:10)</font></button></a>
but Im getting as output:Code:Dim HtmlCollec As HtmlElementCollection HtmlCollec = WebBrowser1.Document.GetElementsByTagName("button") For Each iElement As HtmlElement In HtmlCollec If iElement.GetAttribute("id").Equals("myImageId44") Then RichTextBox1.Text = iElement.ToString End If Next
I'm also trying with:-System.Windows.Forms.HtmlElement
but I get a different link from what I expect.Code:Dim element = WebBrowser1.Document.GetElementById("myImageId44") If element IsNot Nothing AndAlso element.Document.Links.Count > 0 Then Dim link = element.Document.Links(0).GetAttribute("href") End If
To be clear, the website I'm working is this one
This is a GIF to show you




Reply With Quote
