473,320 Members | 1,831 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Driving a web page form from a VB.Net 2005 app

(If there's a better group for this. please let me know.)

What I'm doing is simple in principle, but I'm a winforms guy, not a
webhead, so I'm at a loss as to where to look for the problem here.

Two of the web sites my program uses can't be driven the easy way
(through the URL) but have forms that have to be filled and submitted.
Both are pretty simple, and in both cases I have it working just fine
- most of the time.

The method is simple - find the HtmlElement that has the value(s) to
be set, and use HtmlElement.SetAttribute to store the value. This
works 100% of the time. The only other step is to find and call the
HtmlElement that submits the form with .InvokeMember("click"). One
website uses a java script for the submission and works every time.
The other uses Post, and works about 70% of the time. (Always fills,
doesn't always submit.)

The one that isn't reliable loads a *lot* of graphics and Flash, and,
all this is happening as nine other pages are also loading in other
WebBrowser controls. I originally assumed there was just too much
going on, and even tried using a timer to give the page time to
"settle" after the DocumentComplete fires, but it makes no difference.
It also makes no difference if it's on a 1.7ghz P4/512m or a 3ghz Dual
Core/2g, so I'm sorta doubting it's a muscle issue. OTOH, if it runs
with only that one site loading, the submit works every time - so
there does seem to be some sort of contention involved.

Can anyone give me any clues as to what I'm looking for here? Better
still, is there some newbie mistake I'm probably making? If nothing
else, I can use a timed retry until the url changes, but I'd much
rather find out I'm just doing something wrong...

MikeB
Jul 27 '08 #1
2 890
Do you actually need a WebControl for the non-JavaScript sites? You can do
all of the interaction with the remote site using System.Net.WebRequest.
That way, you don't have to download all the images and Flash stuff.

Andrew
Jul 28 '08 #2
On Mon, 28 Jul 2008 13:49:30 +0100, "Andrew Morton"
<ak*@in-press.co.uk.invalidwrote:
>Do you actually need a WebControl for the non-JavaScript sites? You can do
all of the interaction with the remote site using System.Net.WebRequest.
That way, you don't have to download all the images and Flash stuff.

Andrew
Ahh, but I want to!

The app actually displays the pages themselves for the users - this
isn't a scraper, I'm just driving web pages to save the users repeated
data entry. So the goal is to present them with a page that's just
where it would be if they had entered the info and hit the Submit
button. When that doesn't work, what they get is the page with the
input box filled in, but they then have to click the button
themselves.

I've used the WebCilent (which just wraps webrequest, right?) before,
actually to strip out scripts as a way to kill popus. It's a problem
using that in conjunction with webbrowsers though, because setting the
webbrowsers contents from the response stream will effectively kill
the ability to programmatically control the webbrowser though its uri,
and I haven't found a way around that yet.

MikeB

Jul 28 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: Marty | last post by:
It seems all of the sudden that user controls that contain images are referencing image sources relative to the document that I drop the control on. This obviously does not work beacuase the...
6
by: Mitch | last post by:
I'm trying to use page inheritance so that I can derive all web pages from a template. There are a bunch of examples at this site http://authors.aspalliance.com/PaulWilson/Articles/?id=1, but...
0
by: Simon Harris | last post by:
Ok, this really is driving me nuts!!! :( 'All' I am trying to do is get the value of a named element. My XML doc is: <?xml version="1.0" encoding="utf-16" standalone="yes" ?> - <Page>...
0
by: Simon Harris | last post by:
Ok, this really is driving me nuts!!! :( 'All' I am trying to do is get the value of a named element. My XML doc is: <?xml version="1.0" encoding="utf-16" standalone="yes" ?> - <Page>...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.