Symfony Browserkit link with graphic accentuation does not click

Asked

Viewed 42 times

-3

I am studying Crawler with php symfony and I came across the following situation: inserir a descrição da imagem aqui The link works without accent but when the link has accent simply does not click on the link. I have already checked charset in php app, website and vscode ide all beat. UTF-8 If anyone has an idea how to fix this I’d appreciate it.

I made a change to the script in trying to solve this case.

$link = $crawler->filter('.menu-item')->eq(2);
$crawler = $browser->clickLink($link);
$link = $linkCrawler->link();

I got the following mistake.

inserir a descrição da imagem aqui

1 answer

0

Everything in life is a matter of patience and determination. I’m no expert on the subject and I didn’t even know Symfony for Rawler. After many attempts I arrived at a result that is satisfactory. I finally got a click on the accent link. Of course I had help from a fellow programmer "unknown". https://jciel.github.io/2019/PHP-web-crawler-com-dom-crawler-component-do-symfony/ He gave me a hint and on top of his tip I arrived at the code that runs a click on a link that contains accent:

$link = $crawler->filter('.menu-item')->eq(2)->link();
$crawler = $browser->click($link);
$html = $crawler->html();
echo $html;

It was a ball game. And with that I didn’t even have to change encoding. Is it the windows? I think it’s not just adjustments to the code to get around an obstacle. People are people, codes are codes. For people I have a piece of advice: Don’t judge the other one for just wearing the blue T-shirt. And throw the problem in the color. Now for the code I say there are several ways to eat a Tostines. I’m just eating another way. I presented a problem and many were focused on the color of my shirt. But finally life that follows.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.