Tutup

PHP Java Web Scraper and Crawler

Proyek ini telah diberikan kepada cungthehung dengan harga $40 USD.

Dapatkan penawaran gratis untuk proyek seperti ini
Anggaran Proyek
$40 USD
Total Penawaran
1
Deskripsi Proyek

Hi,

Can you make PHP Java web scraper/crawler for any website by putting a code into PHP file?

Normally, I put a simple htmldom to my PHP file as following:

<?php

function getDetail($ASIN){

$returndata="";

$contents=curlContent($ASIN);

$html = new simple_html_dom();

$pageURL="http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];

if(!empty($contents))

{

$html->load($contents);

if($html->find('div[class="product-details-and-care"] ul')){

foreach($html->find('div[class="product-details-and-care"] ul') as $detail){

$returndata=$detail->plaintext;

$regex = '#<img([^>]*) src="([^"/]*/?[^".]*\.[^"]*)"([^>]*)>((?!</a>))#';

$regex = '#<a([^>]*) href="([^"/]*/?[^".]*\.[^"]*)"([^>]*)>((?!</a>))#';

$returndata = preg_replace($regex,'',$returndata);

}

}

else {echo "There is currently no description for this product. We do not represent or warrant that product descriptions or other Content on this Site is accurate, complete, reliable, current, or error-free.";}

$html->clear();

unset($html);

}

return $returndata;

}

echo getDetail($ASIN);

?>

$ASIN is a page url variable of any web page and this case I using with any product page of [url removed, login to view] such as [url removed, login to view]

A function will find element UL under div class of product-details-and-care and will print data as plaintext when visiting a page and connect with $ASIN, if not found or can't access page will print custom text as 'There is currently no description...'

However, I got a problem when currently this code seems to be old-fashioned or get restricted to access and print data on my webpage.

So, I want to know can you make or develop a code with other language in java or etc to working with my PHP file to let all websites allow me to crawl and scrape their content to displayed on my webpage?

Thank

Diberikan kepada:
Keahlian yang Diperlukan

Ingin menghasilkan uang?

  • Atur anggaran Anda dan jangka waktunya
  • Uraikan proposal Anda
  • Dapatkan bayaran atas pekerjaan Anda

Pekerjakan para freelancer yang juga menawar di proyek ini

    • Forbes
    • The New York Times
    • Time
    • Wall Street Journal
    • Times Online