hosker Posted July 13, 2011 Share Posted July 13, 2011 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. Quote Link to comment https://forums.phpfreaks.com/topic/241868-need-help-with-parsing-an-html-table/ Share on other sites More sharing options...
freelance84 Posted July 13, 2011 Share Posted July 13, 2011 hahahaha! I'm not gonna help you steal somebody else's information from their website. That's just wrong! Why don't you just ask them for it? Else I suggest buying a book on php, mysql and javascript. Quote Link to comment https://forums.phpfreaks.com/topic/241868-need-help-with-parsing-an-html-table/#findComment-1242138 Share on other sites More sharing options...
IrOnMaSk Posted July 13, 2011 Share Posted July 13, 2011 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!!! Quote Link to comment https://forums.phpfreaks.com/topic/241868-need-help-with-parsing-an-html-table/#findComment-1242303 Share on other sites More sharing options...
hosker Posted July 13, 2011 Author Share Posted July 13, 2011 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. Quote Link to comment https://forums.phpfreaks.com/topic/241868-need-help-with-parsing-an-html-table/#findComment-1242311 Share on other sites More sharing options...
max_w1 Posted July 13, 2011 Share Posted July 13, 2011 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/ Quote Link to comment https://forums.phpfreaks.com/topic/241868-need-help-with-parsing-an-html-table/#findComment-1242314 Share on other sites More sharing options...
hosker Posted July 13, 2011 Author Share Posted July 13, 2011 I want to learn PHP, I'm not looking for someone to write the code, but more of a push in the right direction. Quote Link to comment https://forums.phpfreaks.com/topic/241868-need-help-with-parsing-an-html-table/#findComment-1242322 Share on other sites More sharing options...
IrOnMaSk Posted July 13, 2011 Share Posted July 13, 2011 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 :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. 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 Quote Link to comment https://forums.phpfreaks.com/topic/241868-need-help-with-parsing-an-html-table/#findComment-1242327 Share on other sites More sharing options...
premiso Posted July 13, 2011 Share Posted July 13, 2011 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. Quote Link to comment https://forums.phpfreaks.com/topic/241868-need-help-with-parsing-an-html-table/#findComment-1242329 Share on other sites More sharing options...
IrOnMaSk Posted July 13, 2011 Share Posted July 13, 2011 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!!! Quote Link to comment https://forums.phpfreaks.com/topic/241868-need-help-with-parsing-an-html-table/#findComment-1242477 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.