Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > microsoft.public.excel.programming > #109270

Re: Read (and parse) file on the web CORRECTION#2

From Robert Baer <robertbaer@localnet.com>
Newsgroups microsoft.public.excel.programming, microsoft.public.excel
Subject Re: Read (and parse) file on the web CORRECTION#2
References (10 earlier) <TMmxz.72520$lm4.57449@fx05.iad> <nq5272$rni$1@dont-email.me> <nq7fob$6so$1@dont-email.me> <qqUxz.8514$BN1.4915@fx02.iad> <nq9nkm$rtd$1@dont-email.me>
Message-ID <LU2yz.573$jL.521@fx14.iad> (permalink)
Date 2016-09-01 16:32 -0800

Cross-posted to 2 groups.

Show all headers | View raw


GS wrote:
>> GS wrote:
>>>> I thought I'd take a look at going with a userform and MS Web Browser
>>>> control for more flexible programming opts
>>>
>>> While I'm on pause waiting to consult with client on my current
>>> project...
>>>
>>> This is doable; -I have a userform with web browser, a textbox, and some
>>> buttons.
>>>
>>> The Web Browser doesn't display AddressBar/StatusBar for some reason,
>>> even though these props are set 'True'. (Initial URL (pg1) is hard-coded
>>> as a result) You navigate to parent pages using Next/Last buttons,
>>> starting with pg1 on load. Optionally, you can enter a page# in a
>>> GoTo box.
>>>
>>> The browser lets you select links, and you load its current document
>>> page source into txtViewSrc via btnViewSrc. This action also Splits()
>>> page source into vPgSrc for locating search text selected in
>>> cboSearchTxt. The cboSearchTxt_Change event auto-locates your desired
>>> lines at present, but I will have it appending them to file shortly.
>>> This file will be structured same as illustrated earlier. I think this
>>> could be fully automated after I see how the links are define in their
>>> innerHTML.
>>>
>>> For now, I'll provide a button to write found lines because it gives an
>>> opportunity to preview the data going into your file. This will happen
>>> via loading found lines into vaLinesOut() which is sized 0to3. This will
>>> make the search sequence important so the output file has its lines in
>>> the correct order (top-to-bottom in page source).
>>>
>>> I use my own file read/write procedures because they're configured for
>>> large amounts of data in 1 shot to/from dbase.txt files, and so are
>>> included in the userform class.
>>>
>>> While there's still a manual element to this, it's going to be orders of
>>> magnitude less daunting and more efficient that what you do now. It
>>> seems highly likely over time that this entire task can be fully
>>> automated just by entering the URL for pg1!
>>>
>> Way beyond me.
>> If in HTML one can copy an <a href="..."> to the hard drive, then that
>> is all i need.
>
> Just another approach, since you seem to be having difficulty getting
> URLDownloadToFile() to work.
*  snooped around the Excel VB help to find alternate ways (i remember 
seeing other ways). Here was the first step:
SRC1$ = 
"https://www.nsncenter.com/NSNSearch?q=5960%20regulator&PageNumber=5"

''test..
With Worksheets(1)
     .Hyperlinks.Add .Range("E5"), SRC1$
End With
**
   That places the URL in cell E5 and it looked good.
   Clicking once on it "to follow", i get error message "Unable to 
open...Cannot download the information you requested."
   This may have the same 2 problems,the (implied) space,and the https.
   So, to test those,i added a folder on one of my websites: 
http://www.oil4lessllc.com/Try%20.space/
..and that works.
   Therefore, this scheme is one better than the function.
   Next, i tested the https with: https://duckduckgo.com/ .
   I get that error message.
   So i am still dead in the water.

>
> My approach reads innerHTML of web pages and outputs to txt file.
*  THAT is what i cannot do; AFAIK neither HTML5 nor javascript can 
write to a file.

 > Not sure why you want to grab html and save to disc given the file 
size is a
> concern.
* Well, when i first started, i got a bit scared because of those 7750 
(appx) lines; first time i saw a web site that huge.
  Now that i have processed 30 pages, i know better.

 > My approach puts parsed data from all 999 pages into a txt file
> less than 4mb in size. Once the individual steps have been optimized,
> automating the entire process will be easy. (I'll leave that part for
> you to do however you want it to work)
* So far, in that direction, i have:
  <header>
<a 
href="https://www.nsncenter.com/NSNSearch?q=5960%20regulator&PageNumber=5" 
  id="NSN5860" >hello<BR></a>
<script>
      var T = document.anchors;
      document.getElementById("NSN5860").innerHTML = T;
    // open an output stream in a new window
    document.open("text/html",replace);
      document.writeln(T+"|<BR>");
    // display in new window
    document.close();
</script>
<!--  above gets
[object HTMLCollection]
on new screen/window, where that/object item is the href pointer
      -->

>
> I will post the contents of my fParseWebPages.frm file. You will need to
> set a ref to the Microsoft Web Browser to use it.
>

Back to microsoft.public.excel.programming | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Read (and parse)  file on the web Robert Baer <robertbaer@localnet.com> - 2016-08-26 10:57 -0800
  Re: Read (and parse)  file on the web "Auric__" <not.my.real@email.address> - 2016-08-26 15:21 +0000
    Re: Read (and parse)  file on the web "Auric__" <not.my.real@email.address> - 2016-08-26 15:22 +0000
      Re: Read (and parse)  file on the web Robert Baer <robertbaer@localnet.com> - 2016-08-27 13:04 -0800
    Re: Read (and parse)  file on the web Robert Baer <robertbaer@localnet.com> - 2016-08-27 13:00 -0800
    Re: Read (and parse)  file on the web Robert Baer <robertbaer@localnet.com> - 2016-08-27 23:14 -0800
      Re: Read (and parse)  file on the web CORRECTION Robert Baer <robertbaer@localnet.com> - 2016-08-28 09:42 -0800
        Re: Read (and parse)  file on the web CORRECTION#2 Robert Baer <robertbaer@localnet.com> - 2016-08-28 10:08 -0800
          Re: Read (and parse)  file on the web CORRECTION#2 "Auric__" <not.my.real@email.address> - 2016-08-29 01:51 +0000
            Re: Read (and parse)  file on the web CORRECTION#2 Robert Baer <robertbaer@localnet.com> - 2016-08-28 21:32 -0800
              Re: Read (and parse)  file on the web CORRECTION#2 "Auric__" <not.my.real@email.address> - 2016-08-29 19:41 +0000
                Re: Read (and parse)  file on the web CORRECTION#2 Robert Baer <robertbaer@localnet.com> - 2016-08-30 00:21 -0800
                Re: Read (and parse)  file on the web CORRECTION#2 GS <gs@v.invalid> - 2016-08-30 06:06 -0400
                Re: Read (and parse)  file on the web CORRECTION#2 Robert Baer <robertbaer@localnet.com> - 2016-08-30 14:20 -0800
                Re: Read (and parse)  file on the web CORRECTION#2 GS <gs@v.invalid> - 2016-08-30 18:43 -0400
                Re: Read (and parse)  file on the web CORRECTION#2 GS <gs@v.invalid> - 2016-08-31 16:47 -0400
                Re: Read (and parse)  file on the web CORRECTION#2 Robert Baer <robertbaer@localnet.com> - 2016-09-01 04:37 -0800
                Re: Read (and parse)  file on the web CORRECTION#2 GS <gs@v.invalid> - 2016-09-01 13:13 -0400
                Re: Read (and parse)  file on the web CORRECTION#2 Robert Baer <robertbaer@localnet.com> - 2016-09-01 16:32 -0800
                Re: Read (and parse)  file on the web CORRECTION#2 GS <gs@v.invalid> - 2016-09-01 19:43 -0400
                Re: Read (and parse)  file on the web CORRECTION#2 Robert Baer <robertbaer@localnet.com> - 2016-09-01 04:23 -0800
                Re: Read (and parse)  file on the web CORRECTION#2 GS <gs@v.invalid> - 2016-09-05 10:10 -0400
                Re: Read (and parse)  file on the web CORRECTION#2 GS <gs@v.invalid> - 2016-09-05 10:17 -0400
                Re: Read (and parse)  file on the web CORRECTION#3 Robert Baer <robertbaer@localnet.com> - 2016-09-05 20:50 -0800
                Re: Read (and parse)  file on the web CORRECTION#2 Robert Baer <robertbaer@localnet.com> - 2016-09-05 20:32 -0800
                Re: Read (and parse)  file on the web CORRECTION#2 GS <gs@v.invalid> - 2016-09-06 10:49 -0400
                Re: Read (and parse)  file on the web CORRECTION#2 Robert Baer <robertbaer@localnet.com> - 2016-09-06 12:05 -0800
                Re: Read (and parse)  file on the web CORRECTION#2 GS <gs@v.invalid> - 2016-09-06 15:15 -0400
                Re: Read (and parse)  file on the web CORRECTION#2 Robert Baer <robertbaer@localnet.com> - 2016-09-06 22:32 -0800
                Re: Read (and parse)  file on the web CORRECTION#2 GS <gs@v.invalid> - 2016-09-07 11:44 -0400
                Re: Read (and parse)  file on the web CORRECTION#2 Robert Baer <robertbaer@localnet.com> - 2016-09-07 09:33 -0800
                Re: Read (and parse)  file on the web CORRECTION#2 Robert Baer <robertbaer@localnet.com> - 2016-09-08 20:18 -0800
                Re: Read (and parse)  file on the web CORRECTION#2 GS <gs@v.invalid> - 2016-09-09 06:07 -0400
                Re: Read (and parse)  file on the web CORRECTION#2 GS <gs@v.invalid> - 2016-09-09 22:05 -0400
                Re: Read (and parse)  file on the web CORRECTION#2 Robert Baer <robertbaer@localnet.com> - 2016-09-14 17:16 -0800
                Re: Read (and parse)  file on the web CORRECTION#2 GS <gs@v.invalid> - 2016-09-14 20:23 -0400
                Re: Read (and parse)  file on the web CORRECTION#2 "Auric__" <not.my.real@email.address> - 2016-09-07 02:37 +0000
                Re: Read (and parse)  file on the web CORRECTION#2 Robert Baer <robertbaer@localnet.com> - 2016-09-06 22:43 -0800
                Re: Read (and parse)  file on the web CORRECTION#2 "Auric__" <not.my.real@email.address> - 2016-09-08 05:49 +0000
                Re: Read (and parse)  file on the web CORRECTION#2 Robert Baer <robertbaer@localnet.com> - 2016-09-08 01:07 -0800
                Re: Read (and parse)  file on the web CORRECTION#2 "Auric__" <not.my.real@email.address> - 2016-09-09 06:40 +0000
                Re: Read (and parse)  file on the web WGET versions Robert Baer <robertbaer@localnet.com> - 2016-09-08 01:19 -0800
                Re: Read (and parse)  file on the web WGET versions Robert Baer <robertbaer@localnet.com> - 2016-09-08 20:09 -0800
                Re: Read (and parse)  file on the web CORRECTION#2 Robert Baer <robertbaer@localnet.com> - 2016-09-06 23:49 -0800
      Re: Read (and parse)  file on the web GS <gs@v.invalid> - 2016-08-28 15:51 -0400
        Re: Read (and parse)  file on the web Robert Baer <robertbaer@localnet.com> - 2016-08-28 21:37 -0800
        Re: Read (and parse)  file on the web Robert Baer <robertbaer@localnet.com> - 2016-09-02 19:09 -0800
      Re: Read (and parse)  file on the web GS <gs@v.invalid> - 2016-08-29 01:56 -0400
        Re: Read (and parse)  file on the web GS <gs@v.invalid> - 2016-08-29 02:21 -0400
          Re: Read (and parse)  file on the web Robert Baer <robertbaer@localnet.com> - 2016-08-29 19:55 -0800
            Re: Read (and parse)  file on the web GS <gs@v.invalid> - 2016-08-29 23:35 -0400
              Re: Read (and parse)  file on the web Robert Baer <robertbaer@localnet.com> - 2016-08-29 22:25 -0800
        Re: Read (and parse)  file on the web Robert Baer <robertbaer@localnet.com> - 2016-08-29 19:21 -0800
          Re: Read (and parse)  file on the web GS <gs@v.invalid> - 2016-08-29 23:21 -0400
            Re: Read (and parse)  file on the web Robert Baer <robertbaer@localnet.com> - 2016-08-29 22:10 -0800
              Re: Read (and parse)  file on the web GS <gs@v.invalid> - 2016-08-30 04:04 -0400
                Re: Read (and parse)  file on the web Robert Baer <robertbaer@localnet.com> - 2016-08-30 13:48 -0800
          Re: Read (and parse)  file on the web GS <gs@v.invalid> - 2016-08-29 23:37 -0400
            Re: Read (and parse)  file on the web Robert Baer <robertbaer@localnet.com> - 2016-08-29 22:25 -0800
    Re: Read (and parse)  file on the web lovexes17816 <lovexes17816@gmail.com> - 2016-08-28 14:00 +0100
    Re: Read (and parse)  file on the web lovexes17816 <lovexes17816@gmail.com> - 2016-08-29 02:17 +0100
      Re: Read (and parse)  file on the web Robert Baer <robertbaer@localnet.com> - 2016-09-02 19:11 -0800
        Re: Read (and parse)  file on the web "Auric__" <not.my.real@email.address> - 2016-09-03 04:12 +0000
    Re: Read (and parse)  file on the web Tikivn23143 <Tikivn23143@gmail.com> - 2016-08-30 02:28 +0100
    Re: Read (and parse)  file on the web everonvietnam2016 <everonvietnam2016@gmail.com> - 2016-09-07 15:03 +0100
      Re: Read (and parse)  file on the web Robert Baer <robertbaer@localnet.com> - 2016-09-07 08:43 -0800
        Re: Read (and parse)  file on the web "Auric__" <not.my.real@email.address> - 2016-09-08 05:43 +0000
          Re: Read (and parse)  file on the web Robert Baer <robertbaer@localnet.com> - 2016-09-08 01:09 -0800
            Re: Read (and parse)  file on the web "Auric__" <not.my.real@email.address> - 2016-09-09 06:49 +0000
    Re: Read (and parse)  file on the web everonvietnam2016 <everonvietnam2016@gmail.com> - 2016-09-08 11:11 +0100
  Re: Read (and parse)  file on the web GS <gs@v.invalid> - 2016-09-14 17:14 -0400
    Re: Read (and parse)  file on the web Robert Baer <robertbaer@localnet.com> - 2016-09-14 17:19 -0800
      Re: Read (and parse)  file on the web GS <gs@v.invalid> - 2016-09-14 20:26 -0400
        Re: Read (and parse)  file on the web Robert Baer <robertbaer@localnet.com> - 2016-09-15 09:59 -0800
          Re: Read (and parse)  file on the web GS <gs@v.invalid> - 2016-09-15 14:33 -0400
      Re: Read (and parse)  file on the web GS <gs@v.invalid> - 2016-09-14 21:28 -0400
        Re: Read (and parse)  file on the web Robert Baer <robertbaer@localnet.com> - 2016-09-15 10:05 -0800
    Re: Read (and parse)  file on the web Robert Baer <robertbaer@localnet.com> - 2016-09-14 18:48 -0800
      Re: Read (and parse)  file on the web GS <gs@v.invalid> - 2016-09-14 21:59 -0400
        Re: Read (and parse)  file on the web Robert Baer <robertbaer@localnet.com> - 2016-09-15 10:15 -0800
          Re: Read (and parse)  file on the web Robert Baer <robertbaer@localnet.com> - 2016-09-15 22:10 -0800
            Re: Read (and parse)  file on the web GS <gs@v.invalid> - 2016-09-16 11:50 -0400
              Re: Read (and parse)  file on the web Robert Baer <robertbaer@localnet.com> - 2016-09-16 23:54 -0800
                Re: Read (and parse)  file on the web GS <gs@v.invalid> - 2016-09-17 11:06 -0400
                Re: Read (and parse)  file on the web Robert Baer <robertbaer@localnet.com> - 2016-09-17 23:59 -0800
                Re: Read (and parse)  file on the web GS <gs@v.invalid> - 2016-09-18 03:22 -0400
                Re: Read (and parse)  file on the web Robert Baer <robertbaer@localnet.com> - 2016-09-20 00:20 -0800
                Re: Read (and parse)  file on the web GS <gs@v.invalid> - 2016-09-17 11:14 -0400
                Re: Read (and parse)  file on the web Robert Baer <robertbaer@localnet.com> - 2016-09-18 00:18 -0800
                Re: Read (and parse)  file on the web GS <gs@v.invalid> - 2016-09-18 03:30 -0400
      Re: Read (and parse)  file on the web GS <gs@v.invalid> - 2016-09-15 05:02 -0400
        Re: Read (and parse)  file on the web - revised GS <gs@v.invalid> - 2016-09-17 17:15 -0400

csiph-web