Jump to content

Recommended Posts

I am pulling the data from an HTML table off of an existing website. I would like to store that data in my database. I have had no luck trying to get it to work and gave up a few weeks ago.

 

I bought a PHP program that would pull the data from the website and cache it in an html file. I would like to be able to take the data instead and store it into my database. Here is a link to the documentation: http://codecanyon.net/item/php-web-grabber/full_screen_preview/236546. If anyone can help me figure this out I would truly appreciate it.

Link to comment
https://forums.phpfreaks.com/topic/241868-need-help-with-parsing-an-html-table/
Share on other sites

I bought a PHP program that would pull the data from the website and cache it in an html file.

you don't have to buy a program just to do that...

hahahaha!

I'm not gonna help you steal somebody else's information from their website. That's just wrong!

ahahaha! why not!!!!  :( just kidding

I would like to be able to take the data instead and store it into my database

if you really want it, the simplest way is to manually enter the info into the db. Otherwise, I don't think people feel comtable to help you do that!!!

Well, the HTML tables I want to pull from are my own. There is a lot of data and to enter it in manually will take a long time, and that is something I don't have right now. Any assistance or a push in the right direction would be appreciated. I don't have access to my HTML pages at this time, but I can paste a link if you want to see the data at a later time.

Well, the HTML tables I want to pull from are my own. There is a lot of data and to enter it in manually will take a long time, and that is something I don't have right now. Any assistance or a push in the right direction would be appreciated. I don't have access to my HTML pages at this time, but I can paste a link if you want to see the data at a later time.

 

Why don't you Learn PHP and MySql, its beautiful to do it yourself. http://www.w3schools.com/php/

Why don't you Learn PHP and MySql, its beautiful to do it yourself. http://www.w3schools.com/php/

hey max_w1 I came across this article saying that shouldn't sue w3schools resources  ;D :http://w3fools.com/

Well, the HTML tables I want to pull from are my own. There is a lot of data and to enter it in manually will take a long time, and that is something I don't have right now. Any assistance or a push in the right direction would be appreciated. I don't have access to my HTML pages at this time, but I can paste a link if you want to see the data at a later time.

8) hosker, I would suggest using access db to upload the data into your database... this works pretty well for insert into database with lots and lots of data. I'm thinking you might not know how to do it so here are the steps.

1)create access with the exact columns name as your database

2)copy and pasted the data from the website (this is the boring part) into the right columns in the access.

3)upload that access file to your database

4)(fun part) insert into (your database name) select*from (the access file name you just upload)

5)f5 to run DONE!!!

 

the most important part is that the columns in access has to be exact same as columns in your database!!!

well unless someone else comes up with another better magical method to do so.. you might want to try it lol

goodluck  :D

If the html is valid, you can use simplexml to load the data and loop through it and pull it out. It can be a bit tricky, but the man page should help. If the HTML is not valid, then a form of preg_match will be your next step to scrape the data. And finally you would use some form of mysql_query to insert the retrieved data into a database.

 

If you show the code that you attempted to do this with a few weeks ago, it will help motivate people to give you some bigger pushes in the right direction.

 

hey max_w1 I came across this article saying that shouldn't sue w3schools resources  :http://w3fools.com/

You will notice that since the posting of that w3schools has actually gone through and update the content. It is not nearly as bad as it used to be.

If the html is valid... If the HTML is not valid

hey Premiso, just curious, what do you mean by if html is valid or not valid?

hey max_w1 I came across this article saying that shouldn't sue w3schools resources  :http://w3fools.com/

You will notice that since the posting of that w3schools has actually gone through and update the content. It is not nearly as bad as it used to be.

better be cuz I just suggested to someone!!! :)

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.