fixed google piece of shit website i hate it so much

This commit is contained in:
lolcat 2024-08-02 21:25:39 -04:00
parent beb08f46e2
commit 36993013e5
1 changed files with 132 additions and 112 deletions

View File

@ -799,6 +799,41 @@ class google{
$title = "Notice";
}
$div =
$this->fuckhtml
->getElementsByTagName(
"div"
);
// probe for related searches div, if found, ignore it cause its shit
$probe =
$this->fuckhtml
->getElementsByAttributeValue(
"role",
"list",
$div
);
// also probe for children
if(count($probe) === 0){
$probe =
$this->fuckhtml
->getElementsByClassName(
$this->getstyle(
[
"flex-shrink" => "0",
"-moz-box-flex" => "0",
"flex-grow" => "0",
"overflow" => "hidden"
]
),
$div
);
}
if(count($probe) === 0){
$description = [];
$as =
@ -892,23 +927,6 @@ class google{
)
];
}
}else{
// @TODO: Check if this ever gets populated without giving me garbage
/*
$text =
$this->fuckhtml
->getTextContent(
$card
);
if($text != ""){
$description[] = [
"type" => "text",
"value" => $text
];
}*/
}
if(count($description) !== 0){
@ -923,6 +941,7 @@ class google{
];
}
}
}
// reset
$this->fuckhtml->load($html);
@ -2451,6 +2470,7 @@ class google{
$this->getstyle(
[
"outline-offset" => "-1px",
"outline-width" => "1px",
"display" => "flex",
"flex-direction" => "column",
"flex-grow" => "1"