Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Code Support: ASP (Non-Forum Related)
 Please Help With Web Fetching Script
 New Topic  Topic Locked
 Printer Friendly
Previous Page
Author Previous Topic Topic Next Topic
Page: of 2

shaneb
Junior Member

USA
319 Posts

Posted - 20 August 2007 :  21:41:26  Show Profile  Send shaneb a Yahoo! Message
Thanks Paddy and Podge!

Podge I went ahead and used your last script. It works great! Thanks so much. Where would you like me to send the twenty dollars?
I can donate to Huw or whatever you want. Please let me know. BTW the first script worked great also. Paddy, sorry, but I'm
code dumb. You didn't quite give me enough to go on. But
I appreciate your help just the same as well as everyone else
here on Snitz. You guys are awesome.

Just curious. Is it possible to get the colors out of the table border and fonts, before it renders the new table? The colors
don't quite match the site. However, I am thankful that you
made it do exactly what I wanted. I looked all over the place
for something like this.

'Surround your mind and you shall see a great future ahead'

Shane B.


Edited by - shaneb on 20 August 2007 21:42:49
Go to Top of Page

Podge
Support Moderator

Ireland
3776 Posts

Posted - 21 August 2007 :  03:57:19  Show Profile  Send Podge an ICQ Message  Send Podge a Yahoo! Message
The colours are embedded in the table i.e.
<tr>
      <td width="148" valign="bottom" style="width: 110.7pt; border: 1.0pt solid #336699; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; padding-bottom: 0in">
      <p class="MsoNormal" align="center" style="text-align:center"><b>
      <span style="font-family:Arial"><font size="3" color="#0000FF">Car No.</font></span></b></td>
      <td width="148" valign="bottom" style="width: 110.7pt; border-left: medium none #336699; border-right: 1.0pt solid #336699; border-top: 1.0pt solid #336699; border-bottom: 1.0pt solid #336699; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; padding-bottom: 0in">
      <p class="MsoNormal"><b><span style="font-family:Arial">
      <font size="3" color="#0000FF">First</font></span></b></td>
      <td width="148" valign="bottom" style="width: 110.7pt; border-left: medium none #336699; border-right: 1.0pt solid #336699; border-top: 1.0pt solid #336699; border-bottom: 1.0pt solid #336699; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; padding-bottom: 0in">
      <p class="MsoNormal"><b><span style="font-family:Arial">
      <font size="3" color="#0000FF">Last Name</font></span></b></td>
      <td width="148" valign="bottom" style="width: 110.7pt; border-left: medium none #336699; border-right: 1.0pt solid #336699; border-top: 1.0pt solid #336699; border-bottom: 1.0pt solid #336699; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; padding-bottom: 0in">
      <p class="MsoNormal" align="center" style="text-align:center"><b>
      <span style="font-family:Arial"><font size="3" color="#0000FF">Points</font></span></b></td>
    </tr>
Instead of the red line above you could do something like this;
tempTable = myMatches(4) ' Get the fifth table on the page
tempTable = Replace(tempTable, "#336699", "#006600", 0, -1, 1) ' replace #006600 with your preferred colour
tempTable = Replace(tempTable, "valign=""bottom"" style=""width: 110.7pt; border-left: 1.0pt solid #336699; border-right: 1.0pt solid #336699; border-top: medium none #336699; border-bottom: 1.0pt solid #336699; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; padding-bottom: 0in", "", 0, -1, 1) ' get rid of formatting altogether
getTable = tempTable


Using the blue line above as an example you could change the colours of the table to suit your needs. Using the green line you could remove formatting from the table altogether. You will multiple lines like this to remove all formatting.

Podge.

The Hunger Site - Click to donate free food | My Blog | Snitz 3.4.05 AutoInstall (Beta!)

My Mods: CAPTCHA Mod | GateKeeper Mod
Tutorial: Enable subscriptions on your board

Warning: The post above or below may contain nuts.
Go to Top of Page

Podge
Support Moderator

Ireland
3776 Posts

Posted - 21 August 2007 :  04:38:10  Show Profile  Send Podge an ICQ Message  Send Podge a Yahoo! Message
This will remove all formatting from the table while leaving this line at the top so that you can define a css stylesheet for the table.

<table class="MsoTableGrid">


<%
 ' Url of the webpage we want to retrieve
 thisURL = "http://www.i44speedway.com/Trackpoints.htm" 

 ' Creation of the xmlHTTP object
 Set GetConnection = CreateObject("Microsoft.XMLHTTP")
 
 ' Connection to the URL
 GetConnection.Open "get", thisURL, False
 GetConnection.Send 

 ' ResponsePage now have the response of
 ' the remote web server
 ResponsePage = GetConnection.responseText

' We write out now
' the content of the ResponsePage var
Response.write (getTable(ResponsePage))

Set GetConnection = Nothing

Function getTable(pageString)
dim myMatches

Set RegularExpressionObject = New RegExp

With RegularExpressionObject
.Pattern = "<table.*>(.|\n)*?</table>"  
.IgnoreCase = True
.Global = True
End With

set myMatches = RegularExpressionObject.Execute(pageString)

tempTable = myMatches(4) ' Get the fifth table on the page
'###### Remove all formatting
tempTable = Replace(tempTable, "#336699", "#006600", 1, -1, 1) ' replace #006600 with your preferred colour
tempTable = Replace(tempTable, "<td width=""148"" valign=""bottom"" style=""width: 110.7pt; border-left: medium none #006600; border-right: 1.0pt solid #006600; border-top: 1.0pt solid #006600; border-bottom: 1.0pt solid #006600; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; padding-bottom: 0in"">", "<td>", 1, -1, 1) ' get rid of formatting altogether
tempTable = Replace(tempTable, " width=""148"" valign=""bottom"" style=""width: 110.7pt; border-left: medium none #006600; border-right: 1.0pt solid #006600; border-top: medium none #006600; border-bottom: 1.0pt solid #006600; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; padding-bottom: 0in""", "", 1, -1, 1) ' get rid of formatting altogether
tempTable = Replace(tempTable, " width=""148"" valign=""bottom"" style=""width: 110.7pt; border-left: 1.0pt solid #006600; border-right: 1.0pt solid #006600; border-top: medium none #006600; border-bottom: 1.0pt solid #006600; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; padding-bottom: 0in""", "", 1, -1, 1) ' get rid of formatting altogether
tempTable = Replace(tempTable, " class=""MsoNormal""><span style=""font-family:Arial""><font size=""3""", "", 1, -1, 1) ' get rid of formatting altogether
tempTable = Replace(tempTable, "</font>", "", 1, -1, 1) ' get rid of formatting altogether
tempTable = Replace(tempTable, "</span>", "", 1, -1, 1) ' get rid of formatting altogether
tempTable = Replace(tempTable, " class=""MsoNormal"" align=""center"" style=""text-align:center""", "", 1, -1, 1) ' get rid of formatting altogether
tempTable = Replace(tempTable, "<span style=""font-family:Arial""><font size=""3"">", "", 1, -1, 1) ' get rid of formatting altogether
tempTable = Replace(tempTable, "<span style=""font-family:Arial""><font size=""3"" color=""#0000FF"">", "", 1, -1, 1) ' get rid of formatting altogether
tempTable = Replace(tempTable, "<span style=""font-family: Arial; font-weight: 700"">", "", 1, -1, 1) ' get rid of formatting altogether
tempTable = Replace(tempTable, "<font size=""3"" color=""#FF0000"">", "", 1, -1, 1) ' get rid of formatting altogether
tempTable = Replace(tempTable, "<p class=""MsoNormal"">", "<p>", 1, -1, 1) ' get rid of formatting altogether
tempTable = Replace(tempTable, "<span style=""font-family:Arial"">", "", 1, -1, 1) ' get rid of formatting altogether
tempTable = Replace(tempTable, "<font size=""3"" color=""#0000FF"">", "", 1, -1, 1) ' get rid of formatting altogether
tempTable = Replace(tempTable, " width=""148"" valign=""bottom"" style=""width: 110.7pt; border: 1.0pt solid #006600; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; padding-bottom: 0in""", "", 1, -1, 1) ' get rid of formatting altogether
tempTable = Replace(tempTable, " border=""1"" cellspacing=""1"" style=""border: 3px ridge #0000FF; padding-left: 4; padding-right: 4; padding-top: 1; padding-bottom: 1""", "", 1, -1, 1) ' get rid of formatting altogether

getTable = tempTable

Set RegularExpressionObject = nothing

End Function
%>

Podge.

The Hunger Site - Click to donate free food | My Blog | Snitz 3.4.05 AutoInstall (Beta!)

My Mods: CAPTCHA Mod | GateKeeper Mod
Tutorial: Enable subscriptions on your board

Warning: The post above or below may contain nuts.
Go to Top of Page

Podge
Support Moderator

Ireland
3776 Posts

Posted - 21 August 2007 :  04:44:54  Show Profile  Send Podge an ICQ Message  Send Podge a Yahoo! Message
This is an example style sheet you can use at the top of your page;
<style type="text/css">
table.MsoTableGrid {
	border-width: 1px;
	border-spacing: ;
	border-style: outset;
	border-color: gray;
	border-collapse: separate;
	background-color: white;
}
table.MsoTableGrid td {
	border-width: 1px;
	padding: 1px;
	border-style: inset;
	border-color: white;
	background-color: gray;
}
</style>

Podge.

The Hunger Site - Click to donate free food | My Blog | Snitz 3.4.05 AutoInstall (Beta!)

My Mods: CAPTCHA Mod | GateKeeper Mod
Tutorial: Enable subscriptions on your board

Warning: The post above or below may contain nuts.
Go to Top of Page

pdrg
Support Moderator

United Kingdom
2897 Posts

Posted - 21 August 2007 :  10:47:24  Show Profile  Send pdrg a Yahoo! Message
Gold star for Podge - he's a good lad ;-)

Glad you've got it all working now anyway
Go to Top of Page

shaneb
Junior Member

USA
319 Posts

Posted - 21 August 2007 :  22:52:35  Show Profile  Send shaneb a Yahoo! Message
Thanks again Podge! It works and looks great!

Now seriously I told you I would pay. Please send me your PayPal email address.

'Surround your mind and you shall see a great future ahead'

Shane B.

Go to Top of Page

Podge
Support Moderator

Ireland
3776 Posts

Posted - 22 August 2007 :  03:45:54  Show Profile  Send Podge an ICQ Message  Send Podge a Yahoo! Message
Go here - http://forum.snitz.com/donations.asp

Podge.

The Hunger Site - Click to donate free food | My Blog | Snitz 3.4.05 AutoInstall (Beta!)

My Mods: CAPTCHA Mod | GateKeeper Mod
Tutorial: Enable subscriptions on your board

Warning: The post above or below may contain nuts.
Go to Top of Page

shaneb
Junior Member

USA
319 Posts

Posted - 22 August 2007 :  12:31:49  Show Profile  Send shaneb a Yahoo! Message
Done! Thanks Again!

Shane, your order is now complete.
Confirmation Number: 6YL518157M949143H.
An email with your order summary has been sent to xxx@xxx.net
Merchant Contact Information

'Surround your mind and you shall see a great future ahead'

Shane B.

Go to Top of Page

Podge
Support Moderator

Ireland
3776 Posts

Posted - 22 August 2007 :  13:10:41  Show Profile  Send Podge an ICQ Message  Send Podge a Yahoo! Message
No problem.

Podge.

The Hunger Site - Click to donate free food | My Blog | Snitz 3.4.05 AutoInstall (Beta!)

My Mods: CAPTCHA Mod | GateKeeper Mod
Tutorial: Enable subscriptions on your board

Warning: The post above or below may contain nuts.
Go to Top of Page
Page: of 2 Previous Topic Topic Next Topic  
Previous Page
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.23 seconds. Powered By: Snitz Forums 2000 Version 3.4.07