Jump to content

How to grab the 2 listed items from the htm file on the server.


Recommended Posts

I am trying to extract two items from a file on the server. The file is available to the public at the url listed.

name = 301_redirects[request][]

name = 301_redirects[destination][]

Because they are in an array it is above my paygrade.. can anyone give me a hint here.

Once I see how to get them, I will want to save them to a file like this..

request|destination

request|destination

request|destination

etc.. meaining of course the actual values of the items separated by a |

That way it will be easy to load them back in from the file and explode.

I can handle the writing to file, I just need help with the extraction portion.

Some code looks overdone, but all it is I used create to bring the file from the server then comment out the create and minimized the file on the bottom line and used attach from then on to keep testing to try to get it to work..

The _IEPropertyGet is just to make sure I am attached before I try to extract the stuff.

Thanks

; This is the html that needs extracting bout for every line in the tomstats.info/testau3/test.htm file on the server.
; This file is on the server and ready for anyone wanting to help here.
; <td><input name="301_redirects[request][]" value="/homes-listings.asp" style="width: 15em;" type="text">&nbsp;»&nbsp;</td>
; <td><input name="301_redirects[destination][]" value="/idx/mls-2946030-bloomfield_twp_nj_07003_5275" style="width: 30em;" type="text"></td>
  
#include <IE.au3>
; used to get the file in the browser then I can minimize and use attach to save time.
; uncomment the two lines below to get the file on your mimimize line at the bottom of your screen.
; then comment it out and use the attach to keep testing.
; $url = "tomstats.info/testau3/test.htm"
; Local $oIE = _IECreate($url)
$dog = ""
$cnt = 0
; just used to show me it did attach.. otherwise not needed.
; also after the initial create above attach used since it is faster for testing.
; once it loads above I minimize and us attach to make it faster for testing.
Local $oIE = _IEAttach("301 Redirects")
MsgBox(0, "The URL", _IEPropertyGet($oIE, "locationurl"))

; Bottom line here is the real job. I want to extract the two value below.
; name="301_redirects[request][]
; 301_redirects[destination][]
Local $oInputs = _IETagNameGetCollection($oIE, "input")
For $oInput In $oInputs
   ; $dog = 301_redirects[request][5]
   ;$dog = $dog & $oInput.value & "|"
   MsgBox(0, "",$dog)
   $cnt = $cnt +1
if $cnt > 5 then ExitLoop
Next

; I am trying to extract both the value of request and destination.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...