HI,
All
I need a code some thing that can read content of webpages using vb tht is without tags.
Or else a code that can remove all the tags from viewsource after gettin the viewsource in txet file or variable
please let me know is it possible.
Mail if can to (<Removed by Moderator>)
Thanks In Advance.
7 2721
HI,
All
I need a code some thing that can read content of webpages using vb tht is without tags.
Or else a code that can remove all the tags from viewsource after gettin the viewsource in txet file or variable
please let me know is it possible.
Mail if can to (...)
Thanks In Advance.
You can use VB 6.0 Inet Control to read the contents of the webpage and then do operations on them Just do a google search on "vb 6.0 Inet Control" and you will info for this.
-ansuman sahu
You can use VB 6.0 Inet Control to read the contents of the webpage and then do operations on them Just do a google search on "vb 6.0 Inet Control" and you will info for this.
-ansuman sahu
i am using the same but the problem is that it returns the source code from which i found difficulty in retrieving the main contents
eg:
<td width="99%" class="Small"> Also include <span class="SmallBold"> Resume Summary </span></td>
i want "Resume summary"
this is just example.
Thanks for reply
i am using the same but the problem is that it returns the source code from which i found difficulty in retrieving the main contents
eg:
<td width="99%" class="Small"> Also include <span class="SmallBold"> Resume Summary </span></td>
i want "Resume summary"
this is just example.
Thanks for reply
If you simply want to remove all text between '<' and '>', I'll make a function for that, it shouldn't be very hard. ;)
After making function: Okay, it was a little harder than I expected. ~_~; -
Public Function StripHTMLTags(OriginalHTMLCode As String, Optional TagReplaceText As String = "") As String
-
'
-
'OriginalHTMLCode - HTML code to strip tags from
-
'TagReplaceText - What this function will put in place of the
-
'tag (by default, nothing - an empty string)
-
'
-
'Gives back the HTML code with tags replaced by TagReplaceText
-
'
-
Dim StartTagPos As Long
-
Dim EndTagPos As Long
-
Dim TempTagPos As Long
-
-
Dim StartTagNum As Long
-
Dim EndTagNum As Long
-
-
Dim TempChar As String
-
-
StartTagPos = InStr(1, OriginalHTMLCode, "<")
-
-
While StartTagPos > 0
-
-
-
If StartTagPos > 0 Then
-
'An open tag has been found
-
StartTagNum = 1
-
EndTagNum = 0
-
-
'Keep searching until same number of open tags and close tags
-
'have been found (i.e. until nested tags finish >_<)
-
TempTagPos = StartTagPos + 1
-
-
While (EndTagNum < StartTagNum And TempTagPos <= Len(OriginalHTMLCode))
-
-
TempChar = Mid(OriginalHTMLCode, TempTagPos, 1)
-
If TempChar = "<" Then StartTagNum = StartTagNum + 1
-
If TempChar = ">" Then EndTagNum = EndTagNum + 1
-
-
TempTagPos = TempTagPos + 1
-
Wend
-
-
-
End If
-
-
EndTagPos = TempTagPos - 1
-
-
-
StripHTMLTags = TagReplaceText + StripHTMLTags
-
If StartTagPos > 1 Then
-
StripHTMLTags = Mid(OriginalHTMLCode, 1, StartTagPos - 1)
-
End If
-
StripHTMLTags = StripHTMLTags + Mid(OriginalHTMLCode, EndTagPos + 1, Len(OriginalHTMLCode) - 2)
-
-
OriginalHTMLCode = StripHTMLTags
-
-
-
StartTagPos = InStr(1, OriginalHTMLCode, "<")
-
If StartTagPos > 0 Then
-
EndTagPos = InStr(StartTagPos, OriginalHTMLCode, "<")
-
End If
-
-
Wend
-
-
-
End Function
-
Here's an example of how to use it and what it does.
Text1.Text is: -
<html>
-
<b>Hi!!</b>
-
Here's <i>more</i>.
-
</html>
-
Yep.
-
Execute this:
Text2.Text = StripHTMLTags(Text1.Text)
Text2.Text is now:
Hope it's what you needed. :)
...
Mail if can to (<Removed by Moderator>)
Hi.
Just a note to let you know I've removed your e-mail address from the post. See the posting guidelines.
Hi.
Just a note to let you know I've removed your e-mail address from the post. See the posting guidelines.
Err, Killer, it's still in the second post by ansumansahu. ;)
Err, Killer, it's still in the second post by ansumansahu.
No it isn't. :p
If you simply want to remove all text between '<' and '>', I'll make a function for that, it shouldn't be very hard. ;)
After making function: Okay, it was a little harder than I expected. ~_~; -
Public Function StripHTMLTags(OriginalHTMLCode As String, Optional TagReplaceText As String = "") As String
-
'
-
'OriginalHTMLCode - HTML code to strip tags from
-
'TagReplaceText - What this function will put in place of the
-
'tag (by default, nothing - an empty string)
-
'
-
'Gives back the HTML code with tags replaced by TagReplaceText
-
'
-
Dim StartTagPos As Long
-
Dim EndTagPos As Long
-
Dim TempTagPos As Long
-
-
Dim StartTagNum As Long
-
Dim EndTagNum As Long
-
-
Dim TempChar As String
-
-
StartTagPos = InStr(1, OriginalHTMLCode, "<")
-
-
While StartTagPos > 0
-
-
-
If StartTagPos > 0 Then
-
'An open tag has been found
-
StartTagNum = 1
-
EndTagNum = 0
-
-
'Keep searching until same number of open tags and close tags
-
'have been found (i.e. until nested tags finish >_<)
-
TempTagPos = StartTagPos + 1
-
-
While (EndTagNum < StartTagNum And TempTagPos <= Len(OriginalHTMLCode))
-
-
TempChar = Mid(OriginalHTMLCode, TempTagPos, 1)
-
If TempChar = "<" Then StartTagNum = StartTagNum + 1
-
If TempChar = ">" Then EndTagNum = EndTagNum + 1
-
-
TempTagPos = TempTagPos + 1
-
Wend
-
-
-
End If
-
-
EndTagPos = TempTagPos - 1
-
-
-
StripHTMLTags = TagReplaceText + StripHTMLTags
-
If StartTagPos > 1 Then
-
StripHTMLTags = Mid(OriginalHTMLCode, 1, StartTagPos - 1)
-
End If
-
StripHTMLTags = StripHTMLTags + Mid(OriginalHTMLCode, EndTagPos + 1, Len(OriginalHTMLCode) - 2)
-
-
OriginalHTMLCode = StripHTMLTags
-
-
-
StartTagPos = InStr(1, OriginalHTMLCode, "<")
-
If StartTagPos > 0 Then
-
EndTagPos = InStr(StartTagPos, OriginalHTMLCode, "<")
-
End If
-
-
Wend
-
-
-
End Function
-
Here's an example of how to use it and what it does.
Text1.Text is: -
<html>
-
<b>Hi!!</b>
-
Here's <i>more</i>.
-
</html>
-
Yep.
-
Execute this:
Text2.Text = StripHTMLTags(Text1.Text)
Text2.Text is now:
Hope it's what you needed. :)
ok i have solved the problem of removing tags, i have done it getting the source in text file and then removing the the tags.
But what i need is wanna store the source code in a variable as string using inet or web browser, as its possible in it but i think tht variable has some limit of characters.
So any other way to store the source code in variable
Thanks,
Nilesh Patil
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: jonathan.beckett |
last post by:
Hi All,
For the past few months I have been working on an open source
Apache/PHP/MySQL content management system - and have recently made it
available for download.
It's still very much a work in progress (current release version is
0.4.6), but you should get a very good idea of what it's about by
visiting the site (which uses it,...
|
by: Luca |
last post by:
Hello Everybody,
I'm a 26 years old Italian "Florentine" Computer technician :)
I'm writing you about an idea that I've got of a function that could
be introduced in new web browsers (or even in other computer
applications).
I think nobody already had this idea but I'm not sure because I didn't
look deep for it. I don't ask any...
|
by: pcunix |
last post by:
I'm looking for general advice, pointers to web pages, books, whatever.
I have a moderately successful web site. The major complaint that I
get, time after time, is "It's UUUGLY"
As I have explained at http://aplawrence.com/Blog/B1228.html , I
understand that, and to some extent it's deliberate: I am NOT looking
for flash over content...
|
by: enrique |
last post by:
Our server-side software is reading in Big5-encoded data as ASCII when
the web pages are generated. It seems to work most of the time, since
the HTML meta tag is declaring Big5 as the charset. However, every now
and then certain ASCII characters, like the quote (") for example, gets
read in and creates Javascript errors when the browser...
|
by: darrel |
last post by:
I have bits of content on a site that's running of a basic CMS system I've
built.
The main content on each page is pulled in from the DB, so there's at least
one call to the DB on each page load.
But then there's content like the page footer, which is rarely updated, and
is the same on every page.
Since this is rarely updated, but...
| |
by: kinh |
last post by:
In my current PHP project, I have to read pages from a website and
parse the data. If using the Internet browser, I would have to do the
following steps:
Step 1: specify the state to display by using:
www.foo.com/selectState.asp?state=ca
and it will redirect to
www.foo.com/list.asp?city=sanjose&page=1
Step 2....
|
by: brett |
last post by:
I have a main aspx file for my site and use web controls as includes
for content. The url may look like this:
www.abc.com/main.aspx?page1
I'd like to store content in a text file and depending on the url query
string, I'll know which text file to server up into main.aspx. How is
this done?
Also, I'm sure there is a better way to do...
|
by: Electric Co. |
last post by:
Hello,
note: This is for a Faculty web site that is undergoing a migration to
an open source solution so my motives are legit.
I need to build a relay from IIS handling URL_A to a PHP server
(URL_B), get the content from the PHP server (if it exists) and then
serve it out via IIS. If the content does not exist then I need to
pass the...
|
by: pbd22 |
last post by:
Hi.
This is just a disaster management question.
I am using XMLHTTP for the dynamic loading of content in a very
crucial area of my web site. Same as an IFrame, but using XMLHTTP and
a DIV. I got the core of the javascript from here:
http://www.dynamicdrive.com/dynamicindex17/ajaxcontent.htm
I noticed in the demo that sometimes the...
|
by: rrayfield |
last post by:
I have a XML file that contains content for an asp.net website. I need the quickest way to find the node and write the elements out to the page. Also how would I get the links section out of it? do I have to loop through them? Example = I need the content for the Home Page, and I have the id=Home in the xml, how do I get the rest of the data...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
| |
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language...
|
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. ...
|
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...
|
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...
|
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...
|
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...
| |
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...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |