473,765 Members | 2,053 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Parsing text file with ASP

I have a text file that is the result of using XMLHTTP object to pull back a
page of search results from a search engine.

So I have the entire results page in HTML, and want to break out each hit
result from the text file as a unique item and do what I want with each hit
result.

Is there any suggested algorithms or any other techniques I could be
directed to?
Jul 19 '05 #1
5 1926
What exactly is a "hit result?" As far as what you want to do, it'd all
depend on what the html looks like and how consistent it remains. Do you
have control over this remote source? Or is it some other site that can
change on any given day without any forewarning?

Ray at home

"SROSeaner" <SR*******@disc ussions.microso ft.com> wrote in message
news:F9******** *************** ***********@mic rosoft.com...
I have a text file that is the result of using XMLHTTP object to pull back
a
page of search results from a search engine.

So I have the entire results page in HTML, and want to break out each hit
result from the text file as a unique item and do what I want with each
hit
result.

Is there any suggested algorithms or any other techniques I could be
directed to?

Jul 19 '05 #2
Actually, all I really need to do is pull out any text in the HTML text that
is a web site address, so, in the form of http://www._____.__ or starting
with www.

I think I know how to find that, by using InStr and passing it http: (for
example) as the text to look for, but, that will only give me the starting
point of the address correct?

"Ray Costanzo [MVP]" wrote:
What exactly is a "hit result?" As far as what you want to do, it'd all
depend on what the html looks like and how consistent it remains. Do you
have control over this remote source? Or is it some other site that can
change on any given day without any forewarning?

Ray at home

"SROSeaner" <SR*******@disc ussions.microso ft.com> wrote in message
news:F9******** *************** ***********@mic rosoft.com...
I have a text file that is the result of using XMLHTTP object to pull back
a
page of search results from a search engine.

So I have the entire results page in HTML, and want to break out each hit
result from the text file as a unique item and do what I want with each
hit
result.

Is there any suggested algorithms or any other techniques I could be
directed to?


Jul 19 '05 #3
Yes, that'd give you the starting point. The best you can do is have your
code make an educated guess about things when you have no idea what kind of
data will be thrown at it.

If the string contains:

<a href="http://something.com"> click me</a>, should it be ignored because
there's no WWW? Should your code assume that as soon as it finds a ", then
then that is the end of the domain? What about a carriage return? What
about a < character? What about when it's in a sentence in the document,
eg.

Most Web site addresses start with http://www.

Should that be found?

There are lots of variables to deal with, and all you can really do is hope
for accuracy.

Ray at work
"SROSeaner" <SR*******@disc ussions.microso ft.com> wrote in message
news:2F******** *************** ***********@mic rosoft.com...
Actually, all I really need to do is pull out any text in the HTML text
that
is a web site address, so, in the form of http://www._____.__ or starting
with www.

I think I know how to find that, by using InStr and passing it http: (for
example) as the text to look for, but, that will only give me the starting
point of the address correct?

"Ray Costanzo [MVP]" wrote:
What exactly is a "hit result?" As far as what you want to do, it'd all
depend on what the html looks like and how consistent it remains. Do you
have control over this remote source? Or is it some other site that can
change on any given day without any forewarning?

Ray at home

"SROSeaner" <SR*******@disc ussions.microso ft.com> wrote in message
news:F9******** *************** ***********@mic rosoft.com...
>I have a text file that is the result of using XMLHTTP object to pull
>back
>a
> page of search results from a search engine.
>
> So I have the entire results page in HTML, and want to break out each
> hit
> result from the text file as a unique item and do what I want with each
> hit
> result.
>
> Is there any suggested algorithms or any other techniques I could be
> directed to?


Jul 19 '05 #4
You have DOM parsers available but your code will break if the architecture
of the page change. I would rather use an API or a "service" if
available....

Patrice

--

"SROSeaner" <SR*******@disc ussions.microso ft.com> a écrit dans le message de
news:2F******** *************** ***********@mic rosoft.com...
Actually, all I really need to do is pull out any text in the HTML text that is a web site address, so, in the form of http://www._____.__ or starting
with www.

I think I know how to find that, by using InStr and passing it http: (for
example) as the text to look for, but, that will only give me the starting
point of the address correct?

"Ray Costanzo [MVP]" wrote:
What exactly is a "hit result?" As far as what you want to do, it'd all
depend on what the html looks like and how consistent it remains. Do you have control over this remote source? Or is it some other site that can
change on any given day without any forewarning?

Ray at home

"SROSeaner" <SR*******@disc ussions.microso ft.com> wrote in message
news:F9******** *************** ***********@mic rosoft.com...
I have a text file that is the result of using XMLHTTP object to pull backa
page of search results from a search engine.

So I have the entire results page in HTML, and want to break out each hit result from the text file as a unique item and do what I want with each hit
result.

Is there any suggested algorithms or any other techniques I could be
directed to?


Jul 19 '05 #5
Thanks for your help guys. I figure I will just have to code it in a way to
take care of all the variables in such a situation.

"Patrice" wrote:
You have DOM parsers available but your code will break if the architecture
of the page change. I would rather use an API or a "service" if
available....

Patrice

--

"SROSeaner" <SR*******@disc ussions.microso ft.com> a écrit dans le message de
news:2F******** *************** ***********@mic rosoft.com...
Actually, all I really need to do is pull out any text in the HTML text

that
is a web site address, so, in the form of http://www._____.__ or starting
with www.

I think I know how to find that, by using InStr and passing it http: (for
example) as the text to look for, but, that will only give me the starting
point of the address correct?

"Ray Costanzo [MVP]" wrote:
What exactly is a "hit result?" As far as what you want to do, it'd all
depend on what the html looks like and how consistent it remains. Do you have control over this remote source? Or is it some other site that can
change on any given day without any forewarning?

Ray at home

"SROSeaner" <SR*******@disc ussions.microso ft.com> wrote in message
news:F9******** *************** ***********@mic rosoft.com...
>I have a text file that is the result of using XMLHTTP object to pull back >a
> page of search results from a search engine.
>
> So I have the entire results page in HTML, and want to break out each hit > result from the text file as a unique item and do what I want with each > hit
> result.
>
> Is there any suggested algorithms or any other techniques I could be
> directed to?


Jul 19 '05 #6

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

Similar topics

4
2659
by: ralphNOSPAM | last post by:
Is there a function or otherwise some way to pull out the target text within an XML tag? For example, in the XML tag below, I want to pull out 'CALIFORNIA'. <txtNameUSState>CALIFORNIA</txtNameUSState>
3
3506
by: Pir8 | last post by:
I have a complex xml file, which contains stories within a magazine. The structure of the xml file is as follows: <?xml version="1.0" encoding="ISO-8859-1" ?> <magazine> <story> <story_id>112233</story_id> <pub_name>Puleen's Publication</pub_name> <pub_code>PP</pub_code> <edition_date>20031201</edition_date>
26
6876
by: SL33PY | last post by:
Hi, I'm having a problem parsing strings (comming from a flat text input file) to doubles. the code: currentImportDetail.Result = CType(line.Substring(7, 8).Trim(" "), System.Double) What is in my Watch:
1
2298
by: Thomas Kowalski | last post by:
Hi, I have to parse a plain, ascii text file (on local HD). Since the file might be many millions lines long I want to improve the efficiency of my parsing process. The resulting data structure shall look like this the following: class A { ... int value; }
4
6842
by: Neil.Smith | last post by:
I can't seem to find any references to this, but here goes: In there anyway to parse an html/aspx file within an asp.net application to gather a collection of controls in the file. For instance what I'm trying to do is upload a html file onto the web server, convert it to aspx file and then parse it for input tags/controls, which in turn will become fields in a newly created database table. Clearly when the aspx file is called the...
3
4386
by: toton | last post by:
Hi, I have some ascii files, which are having some formatted text. I want to read some section only from the total file. For that what I am doing is indexing the sections (denoted by .START in the file) with the location. And for a particular section I parse only that section. The file is something like, .... DATAS
2
2106
by: hzgt9b | last post by:
I've written a simple javascript page that parses an XML file... (Actually I just modified the "Parsing an XML File" sample from http://www.w3schools.com/dom/dom_parser.asp) The page works great standalone... but when I try to make this work under frames I get "Error: Object required" when the following line executes: xmlDoc.getElementsByTagName("to"); The standalone file is named treeView.htm (attached). You should be
13
4512
by: Chris Carlen | last post by:
Hi: Having completed enough serial driver code for a TMS320F2812 microcontroller to talk to a terminal, I am now trying different approaches to command interpretation. I have a very simple command set consisting of several single letter commands which take no arguments. A few additional single letter commands take arguments:
1
2152
by: martinsson | last post by:
Hi all! I'm pretty mad about this... dont know what is going on. Im parsing XML file that looks like this: <something> __<item att="something">text<item> __<item att="something">text<item> __<item att="something">text <span class="some">inside text</span> text<item>
2
2591
by: python | last post by:
I'm parsing a text file for a proprietary product that has the following 2 directives: #include <somefile> #define <name<value> Defined constants are referenced via <#name#syntax. I'm looking for a single text stream that results from processing a file containing these directives. Even better would be an iterator(?) type
0
10156
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9951
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9832
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7375
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6649
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5275
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3924
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3531
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2805
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.