473,411 Members | 1,918 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,411 software developers and data experts.

Extracting Data

133 100+
Hi,

How would i go about doing the following.

I have a URL like this e.g. www.website.co.uk/orgs-details.asp?OrgsID=

On this page there is Company Name, Contact:, Tel, E-mail: and Web site:

I want to extract these details and add them into a table.

How would i do this?

This is how the data is shown if this helps?
Expand|Select|Wrap|Line Numbers
  1. <table width="385" border="0" cellspacing="0" cellpadding="0"> 
  2.               <tr> 
  3.                 <td valign="top"><h1>Company Name</h1> 
  4.                   <table width="100%" border="0" cellspacing="0" cellpadding="3"> 
  5.                     <tr> 
  6.                       <th width="30%"><strong>Contact:</strong></th> 
  7.                       <td width="70%"><strong>Persons Name 
  8.                         </strong> </td> 
  9.                     </tr> 
  10.  
  11.                     <tr> 
  12.                       <th><strong>Tel:</strong></th> 
  13.                       <td><strong>000 000 000</strong></td> 
  14.                     </tr> 
  15.                     <tr> 
  16.                       <td>&nbsp;</td> 
  17.                       <td><span class="small">Information Here</span>.</td>
  18.  
  19.                     </tr>
  20.  
  21.                     <tr> 
  22.                       <th><strong>E-mail:</strong></th> 
  23.                       <td><strong><a href="info@website.com">info@website.com</a></strong></td> 
  24.                     </tr> 
  25.  
  26.                     <tr> 
  27.                       <th><strong>Web site:</strong></th> 
  28.                       <td><strong><a href="http://www.website.com" target="_blank" id="451" onClick="return trackclick(this.id);" title="Visit Site">www.website.com</a></strong></td> 
  29.                     </tr> 
  30.  
  31.                   </table>

Cheers,
Adam
Mar 4 '08 #1
4 1187
ronverdonk
4,258 Expert 4TB
I do not understand exactly what you want to accomplish.

Is that url you show yours? Or do you want to 'scrape' a website: extract the data from a remote website and store it into your own page?

And what are the 'tables'you talk about, your HTML table or a database table?

Ronald
Mar 4 '08 #2
TheServant
1,168 Expert 1GB
Who puts the data on there? If it is the companies themselves they must use a form, and you could just incorporate some database storage code with the form.

Also, is that data currently being called by the page (using sessions, MySQL or something else), or is it just written in the html? If it is being called then you already have the information stored.

If you just want to know how put a name in a table, you need to use php in something like:
[HTML]<tr>
<th width="30%"><strong>Contact:</strong></th>
<td width="70%"><strong><?php echo($persons_name); ?></strong> </td>
</tr>[/HTML]

If this makes no sense, you need to learn php, inparticular: variables.
Mar 4 '08 #3
adamjblakey
133 100+
I want to extract data from one of my old sites and put it into a an sql database.

So basically i need something that will loop through all the page e.g. id=1, id=2 etc and will put the data from each id into an sql database table.
Mar 4 '08 #4
adamjblakey
133 100+
Could something like this be adapted to work that i have used in the past to extract email addresses:

[PHP]
for($i=1;$i<$max_val;$i++) {
$content = file_get_contents('http://www.website.com/slist.php?item='.$i);
preg_match_all($email_match_regex, $content, $matches);
if(count($matches[0])) {
foreach($matches[1] as $index => $value) {
$insert_id = mysql_query('INSERT INTO.....');
}
}
}
[/PHP]
Mar 5 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Steve | last post by:
Hi, I have a very long string, someting like: DISPLAY=localhost:0.0,FORT_BUFFERED=true, F_ERROPT1=271\,271\,2\,1\,2\,2\,2\,2,G03BASIS=/opt/g03b05/g03/basis,...
5
by: Michael Hill | last post by:
Hi, folks. I am writing a Javascript program that accepts (x, y) data pairs from a text box and then analyzes that data in various ways. This is my first time using text area boxes; in the past,...
1
by: v0lcan0 | last post by:
Any help on extracting the time part from the datetime field in SQL database. even though i had entered only the time part in the database when i extract the field it gives me only the date...
3
by: Alfred | last post by:
Hi I would like to extract only 15 records at a time from the backend in alfabetic order. Click on a button and then the next 15. Reason data must come over a 56k modem. The data is not...
0
by: Nadav | last post by:
Hi, Introduction: *************************** I am using the MSI API to extract MSI embedded files, I do this by iterating through all of the records in the ‘_Streams’ table and dumping...
2
by: Dickyb | last post by:
Extracting an Icon and Placing It On The Desktop (C# Language) I constructed a suite of programs in C++ several years ago that handle my financial portfolio, and now I have converted them to...
13
by: Randy | last post by:
Is there any way to do this? I've tried tellg() followed by seekg(), inserting the stream buffer to an ostringstream (ala os << is.rdbuf()), read(), and having no luck. The problem is, all of...
0
by: runner7 | last post by:
I used file_get_contents() to read a pdf into a string and then tried to extract the encoded part between the "stream" and "endstream" words using the strpos() and substr() functions. (I could not...
0
by: sgsiaokia | last post by:
I need help in extracting data from another source file using VBA. I have problems copying the extracted data and format into the required data format. And also, how do i delete the row that is not...
6
by: Werner | last post by:
Hi, I try to read (and extract) some "self extracting" zipefiles on a Windows system. The standard module zipefile seems not to be able to handle this. False Is there a wrapper or has...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
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...
0
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...

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.