Keyword scraper error


This is my script

it’s scraping keyword from google…

but when run give problem.

2 error:

Maximum execution time of 30 seconds exceeded…


my language is Persian and supported utf-8

but can’t scraper persian keyword

and 1 question
how use ajax to display keyword list extracted . w

if (isset($_POST["keyword"]) && $_POST['keyword'] !== "") {
$alphas1 = range('A', 'Z');
$alphas2 = range('A', 'Z');
$keyword = $_POST['keyword'];
foreach ($alphas1 as $a1) { foreach ($alphas2 as $a2) {
$xml = simplexml_load_file(utf8_encode("$keyword.' '.$a1.$a2"));

foreach ($xml->children() as $child) {
foreach ($child->suggestion->attributes() as $dta) {
echo "<br>";
echo $dta;
} else {
<form action="<?php $_SERVER['PHP_SELF'];?>" method="post">Keyword: <input type="text" name="keyword" required><input type="submit"></form>

You’re making a lot of queries, one after the other, and it’s going over some time out limit. One possibility: use ParallelCurl

1 Like