Get Elements By Tag Name From Webpage?
Feb 10, 2010I'm attempting to grab data from a webpage, but I've been unsuccessful in my attempts.
View 1 RepliesI'm attempting to grab data from a webpage, but I've been unsuccessful in my attempts.
View 1 Repliesi am using a webbrowser control on a windows form to display streaming video from cameras at different locations.i can get the image to display on the webrowser but my problem is that there are other links and texts that are displayed on the webpage.
View 2 RepliesI want to get the links and images from an html code using the htmlDocument class available through webBrowser.So I retrieved and assigned the html code to the webBrowser trying each one of this 3
[Code]...
I'm creating an application that will be visiting several different sites.Each site will have the same elements but not necessarily in the same order.On a previous post I was told to use the Select Case to choose between the choices.Can Select Case be used to choose between Webpage elements?Let's say that on one site the first web page element is choose button A but on site two it will choose button B.
Dim makeachoice As String
makeachoice = webbrowser1.element button A
Case signin
[code].....
What I need to do is grab all the web page elements on a web page (id, name, etc) and place them into a textbox to view...Currently I have this
Dim htmlElements As HtmlElementCollection = WebBrowser1.Document.GetElementsByTagName("input")
For Each el As HtmlElement In htmlElements
If el.GetAttribute("name").Equals("name") Then
[code]....
I want to make an application that takes values & innerhtml from some elements on a webpage i made. For that i added a webbrowser to the project, and pointed it to navigate to my localhost server where i have some pages. However when i use the document.getelementbyid i don't get nothing on my richtextbox, and i don't know why, i use this function lot in javascript & i think its quite similar, so i don't know why it doesn't work , here is the code i use.
[Code]...
I created a method and pass the element type, id, and any inner text that instantiates a new html element. The last statement: Me.Controls.Add(element) adds it to the end of the page, but I would like it to be inserted in a specific position (between 2 divs within a form). What I am describing is very similar to this post on SO here, although it was for javascript.
View 1 Repliesi have an aspx page with vb.net back end. in that page i get names and url's from the database depending on different conditions. My requirement is that when i get the url, the code should then use that url and have that webpage in a small preview form on my existing aspx page. so basically i have a table as follows -
[Code]...
Dim Document = XDocument.Load(FileName)
Dim findElement = Document.Elements("GradeProfile")
[code]....
I making a webpage with the help visual basic. I wanted to put a flv video in it and i used flash control for asp.net [URL]. I made the player in flash told it to download the video from the sever. Now when i put the player on the webpage and put the webpage on the sever it cant play the video. But when i just pres the the player which is in swf format it works. It can download the video. But when i put the player on my webpage it cant.
View 5 RepliesDuplicate:good references or tools available for converting from ASP to ASP.NET?How i can convert an ASP Classic webpage into an ASP.NET webpage?
View 1 RepliesI'm using Visual Studio 2008.I've recently begun toying with XML, because I have been using XLS up to this point. I want my apps to be more flexible.
OBJECTS:
Label1
Button1
Profile.xml (ok, not really an object, but you know ...)
GOAL: To display the Sum of <Calories> in Label1.Text when Button1 is clicked.
Here is the XML file (Profile.xml):
<?xml version="1.0" encoding="utf-8"?>
<Days>
<Date>[code].....
I am trying to add the values in my array.. and this is my code
dim totals(6) as decimal
public function AddIBNRTotal(byval Amt as decimal,srvcdesc as string) as decimal
if srvcdesc = "ZZ_TOTAL" then
[Code]....
I know the addIBNRfunction works fine cause it is displaying the correct amounts in my textbox
but when i call the Sumnumber() i am getting 70000 dollars short...
So is this the right way to add values or elements to a array...
<data>
<food>
<id>1</id>
<name>asparagus</name>
[Code]....
i would like to get the unique catlogs, so from this list i want to extract only 7190, 7192, and 7193. i have a script that puts it into a dropdownlist by using:
DropDownList1.DataSource = dv
DropDownList1.DataBind()
but i need it to get only the unique values.
I have the following piece of XML:
<xml>
<ObsCont xCampo="field1">
<xTexto>example1</xTexto>
[Code]....
How do I (using linq) get for example what is inside the xTexto tag that has as parent the ObsCont with the xCampo attribute "field2" ?
I have a collection (a Dictionary, actually) of strings as the key and strings as the value. The value strings are filenames. I wish to find which elements contain a certain filename as the value, returning the Key so that I can modify the Value (change the filename).[code]....
View 4 RepliesHere's a portion of my XML string.
<OpenSearchDescription>
<opensearch:Query searchTerms="Star Wars"/>
<opensearch:totalResults>18</opensearch:totalResults>
[Code]....
Here's a portion of my xml file
<sources><comicbooks><source>
<profile>0</profile>
<name>Main</name>
<path>*mypath not showing*</path>
</source></comicbooks></sources>
I am also using a schema file for the sources.xml file.
Here's my
Dim fileSources As IO.File
If fileSources.Exists(filePath & "sources.xml") Then
Try
Dim Sources As XDocument = XDocument.Load(filePath & "sources.xml")
[Code] .....
lbSources doesn't get populated with anything and Label2 doesn't change either.
I have been learning VB.NET and am currently having troubles retrieving data from an XML file. I'm trying to keep the code as simple as possible as I only need to select single items from an XML file, not rows of data.
The XML file contains:
<CurrentPeakUsage xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://au.com.amnet.memberutils/">
<Period>
[code]....
While the msgbox will contain the entire XML document, so it is loading correctly, I can't pull the single element value.
How would you code this so that it adds up the first column, and then the second column?
Dim intSales(,) As Integer = {{100000, 150000}, _
{90000, 120000}, _
{75000, 210000}, _
[Code].....
There are 6 buttons have the same name in page i wantto click 3th button this code works:
WebBrowser1.Document.All.GetElementsByName("bid").Item(2).InvokeMember("click")
but this doesnt work :
WebBrowser1.Document.All.GetElementsByName("bid").Item(TextBox1.text).InvokeMember("click")
it gives error while debugging
I can create an ArrayList, but, is it possible to create it WITH some elements already?Normally, your arrays are empty, but what if I want to create an array with a few elements already?
View 2 RepliesI've managed to get my CSV file opened and the individual elements of each line read into an array. I've also managed to count and list the number of elements in the first row (i.e. the column headers).
[code]...
listOfNewFileRecords.Add(currentRow)' ADD EACH RECORD TO THE LIST AS THE FILE IS BEING READ Now the next stage is to access various cells within the whole opened file, so that I can condition/modify the text.So does 'ListOfNewFileRecords' have a way/method of accessing a particular element, in each record of the 'List'? I've tried using the intellisense, but can't make enough sense out of it to get anything to work.
how to search XML trees with LINQ using VB.net. I've found some very helpful posts for C#, but none for VB.net?How would I use LINQ to XML to get the value from example XML Getting a set of elements using linq How to get elements value with Linq To XML I want to get the inputlocation for the process where name = "MyProcess1" Based on the example links above, I have been trying code like this:
Dim inputLocation As String = xdocument.Descendants("Configurations").Descendants("process").First(Function(c) c.Element("name").Value = "MyProcess1").Element("inputLocation").Value
But the code is not returning any values. here is the xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Configurations>
<process>
[code]....
I am trying to create a array and then add elements to it based on some conditions and then add the elements in the array and display it...
but i am getting a larger number that expected..
this is my code
Dim IBNRTotal as decimal
dim element as integer
dim totals(6) as decimal -- create a array3
[Code]....
i know the amt value correct cause in return amt.. i am seeing the right value but somehow when it goes to the array and when i add the whole thing it doesnt seems right...
I am just starting VB at 60 years old and with no programming experience and nobody to ask for help...except here, of course. So needless to say I am hitting brickwalls. I am using "Murach's Visual Basic 2008" and it seems to be a good book. This is what I am up to I have to declare an array with 5 elements with an index. I think that part is OK. Then add code that adds each element to the next one every time a user clicks a button. I have had many tries but the best I can get is just the grand total of the elements. Here is the code I came up with:-
[Code]...
Is anyone able to show me how the button click would reveal a progressive total of the elements each time a user clicked on it? It would be good if the book came with answers or had a forum for their readers.
I want to copy the elements from one list to another.
View 4 Repliesway to assign value to elements of an Array. For an example,
Assign each Cheque1 to Cheque50 to the array (named as "Cheques()" ) elements.>>
Cheques(1) = Cheque1
Cheques(2) = Cheque2
Cheques(3) = Cheque3
[Code]....
tell me an efficient method of retrieving the CSS between tags on a page of markup in .NET?I've come up with a method which uses recursion, Split() and CompareTo() but is really long-winded, and I feel sure that there must be a far shorter (and more clever) method of doing the same.it is possible to have more than one element on a page, and that the element can be either or .
View 3 RepliesHow is it possible to take an XML document and in .Net scramble all text elements to make them un-readable to a human?
[Code]....
We only need scrambling not encryption, i.e. not human readable at a glance. It doesnt matter if the user could de-code it with 30 seconds effort. We dont know the schema of the XML, so all text elements must be located in code. We need to de-scramble the XML later how one would do that too. It needs to be simple, e.g. no pre-sharing keys, certificates, etc. Only the text elements should be scrambled - not the nodes, attributes, etc.