Hi everyone,
I need help in extracting html codes from websites.
There are some program that can extract captchas from websites. Some directories submitter software has it.
Let me give an example for a better picture.
let's say I want to extract form codes from a page.
So I want this program/script to extract the whole codes from
<form.... until ...</form>
How do I do that in php?
Extracting specific Html codes from websites
Moderator: General Moderators
Re: Extracting specific Html codes from websites
do you know XML? php has this xml feature... you can parse XML... basically html tags are like xml anyway.. but xml will surely solve your problem.
Re: Extracting specific Html codes from websites
Look at preg_match() or preg_match_all()
Code: Select all
preg_match_all('/<form>.+?<\/form>/ism', $HTMLContents, $matches);
echo '<pre>';
print_r($matches);
echo '</pre>';Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.