I want to modify a URL of an object that I am extracting from another site, in this case, from Exame.com.
Follow the code:
$exame = file_get_html("http://exame.abril.com.br/");
$exame_posts = $exame->find("p.content-item-title");
foreach($exame_posts as $i => $value){
if($i < 10){
echo $value;
}
}
The code is simple, it takes the "p" tags with the "content-item-title" class and limits to 10 and prints the 10.
The question is: how do I modify the url of some of these links that I get? Some links I can access the website of Exame.com, others (few) do not. I'll show an example of how some links are:
The links as they are generated in the HTML page:
HowdoestheurlgetwhenIclickononeofthem:
And after the url is correct, how to avoid a possible conflict on those other links that are without error?
Hugs!