Question: Write a PHP script which uses the libraries discussed in class to screen-scrape a cartoon from a website. Your program should grab several cartoons from

Write a PHP script which uses the libraries discussed in class to screen-scrape a cartoon from a website.

Your program should grab several cartoons from any website. If the cartoon is updated daily, get the last 7 cartoons. If it is updated weekly, grab the last four. If it's less frequent, just grab some number that makes sense.

You may not use XKCD or any GoComics cartoon, or any Comics Kingdom cartoon, because those were the samples discussed in class.

(I have tried using mangas as well for this: Black Lagoon and Attack on Titan but couldn't quite figure it out. The most I can do is have the one page showing but not the rest or the number that is required to have)

EDIT: This is the current code I have for this assignment. I hope this will be sufficient. Thank you and I apologize for any inconvenience

include_once('./simple_html_dom.php');

$url = "https://www.mangaeden.com/en/en-manga/black-lagoon/96/1/"; $page = file_get_html($url);

$howmany = 3; while($howmany >= 0) { $location = $page->find('a[class=ui-state-default prev]', 0)->href; $page->clear(); $page = file_get_html($url . $location); $howmany -= 1; }

// Come forward to first page do { docomic($url . $location); $location = $page->find('a[class=ui-state-default prev]', 0)->href; $page->clear(); $page = file_get_html($url . $location); } while($location != '/en/en-manga/black-lagoon/96/2/');

function($url) { $html = file_get_html($url); $comic_image = $html->find('a[id=nextA] img', 0) -> src; print('' . " "); }

?>

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!