1

Something I have been trying to do and still can't get done. Reading the information typed in a website input field and being able to copy that.

Is there a way I can read the ty

dave123
  • 421
  • 1
  • 6
  • 15
  • Can you execute Javascript against the page you render in the web browser control? is that your page or any page of the internet? if you can control the page because it belongs to you I would try with JQuery if it's possible to store the value in an hidden field for example, then I would access the dom and read the value. – Davide Piras Feb 03 '11 at 09:27
  • no it is not my page on the internet, its any page. thats why its so difficult – dave123 Feb 03 '11 at 09:33

2 Answers2

4

try these articles about using TWebBrowser and delphi to read data from a web page.

RRUZ
  • 134,889
  • 20
  • 356
  • 483
  • thx, found those before as well, but its the wrong way around. They are about placing text in boxes and not retrieving text from input fields.... – dave123 Feb 03 '11 at 15:30
  • @ployo replace `A := B` with `B := A` – David Heffernan Feb 03 '11 at 15:37
  • @ployo60 I tell you what, why don't you send me the details of your project, I'll do it for you and send it back to you. – David Heffernan Feb 03 '11 at 15:38
  • @ployo60, are you sure ('...They are about placing text in boxes and not retrieving text from input fields')? do you read the article ? http://www.cryer.co.uk/brian/delphi/twebbrowser/read_write_form_elements.htm#GetValueOfField – RRUZ Feb 03 '11 at 15:43
  • @ployo60 - this is the answer to your question. Don't expect people writing code for you. Please mark this as accepted and move on with your research, you need to learn quite a few things yet. – Leonardo Herrera Feb 03 '11 at 19:25
  • @David, no don't worry about it. I've done it with reading the keys that are typed. I believe that should work as well..... – dave123 Feb 04 '11 at 15:31
  • @RUZZ, yeah or I am not understanding it properly..... it gives me the information about the input field like name and id and stuff, but not the content..... That is waht I am after... – dave123 Feb 04 '11 at 15:32
  • @ployo60 - did you bother reading the first page, at least? It has a section titled 'Set the value of a named field'! – Leonardo Herrera Feb 05 '11 at 04:19
  • @Leonardo Herrera - Yes I have read the page and I don't expect the code from anyone, just a hint in the right direction. But the page does not describe what i am after. I dont want to set the value. I want to take the value when it is typed in. from webbrowser input field to an edit box on the form..... – dave123 Feb 05 '11 at 19:14
  • @ployo60 - I insist - you need to read that documentation. What you want can be done if you modify the page and insert your own code. You can use some form of timer to get the values. I remember doing some pretty hairy stuff with the DOM back in my time. I know Nick Bradbury does some pretty nice things with it too in his FeedDemon program. – Leonardo Herrera Feb 06 '11 at 00:35
  • @Leonardo Herrera - yeah I had a look at that as well. I'm going to have a closer look on the idea. But I do understand what you mean now! Thx – dave123 Feb 06 '11 at 15:14
1

Javascript

document.getElementById('input-field-id').value 

returns the contents of an input box. What are you trying to do?

dustinl4m3
  • 159
  • 2