我正在使用Symfony Panther和Laravel框架。我在使用这个时出错了
(Facebook\WebDriver\Exception\UnknownErrorException(code:未知错误:无法为用户数据dir创建临时dir {“异常”:“对象
0):
I已经安装了XAMPPforWindows7.4.2.
PHP: 7.4.2,Apache2.4.41
composer.json
"require": {
"php": "^7.1.3",
"fabpot/goutte": "^3.2",
"fideloper/proxy": "^4.0",
"guzzlehttp/guzzle": "~6.0",
"laravel/framework": "5.7.*",
"laravel/tinker": "^1.0",
"symfony/css-selector": "^4.4",
"symfony/http-client": "^4.4",
"symfony/panther": "^0.7.0"
}拉幅控制器级
namespace App\Http\Controllers;
include (base_path() .'/vendor/autoload.php');
use Illuminate\Http\Request;
use Symfony\Component\DomCrawler\Crawler;
use Symfony\Component\BrowserKit\HttpBrowser;
use Symfony\Component\HttpClient\HttpClient;
class PageController extends Controller
{
public function myFunction(Request $request)
{
$client = \Symfony\Component\Panther\Client::createChromeClient();
$client->request('GET', 'https://api-platform.com'); // Yes, this website is 100% written in JavaScript
$client->clickLink('Support');
// Wait for an element to be rendered
$crawler = $client->waitFor('.support');
echo $crawler->filter('.support')->text();
}
}2020-02-27 16:12:21 local.ERROR:未知错误:无法为用户数据dir local.ERROR创建临时dir
发布于 2020-02-27 18:38:51
%TEMP%和%TMP%环境变量运行,并确保它们的存在。(为此,在Windows的命令行上运行echo %TEMP%和echo %TMP% )Related: "cannot create temp dir for user data dir" error when not running as admin
https://stackoverflow.com/questions/60439567
复制相似问题