小编ahm*_*eed的帖子

如何使用 symfony/panther 设置代理服务器

我发现有两种设置代理服务器的方法,一种是通过 chrome web 驱动程序功能,另一种是在创建 chrome 客户端时直接设置

$this->client = Client::createChromeClient(null, [
            '--proxy-server=socks://196.14.52.63:35048',
            '--headless',
            "--disable-gpu",
]);
Run Code Online (Sandbox Code Playgroud)

但在设置代理 IP 和端口后,我收到以下错误:

Curl error thrown for http POST to /session/cce06908d68a1e96bc6d1cb3b798aa14/url with params: {"url":"https:\/\/some-site\/login"}\n
Operation timed out after 30001 milliseconds with 0 bytes received
Run Code Online (Sandbox Code Playgroud)

基本上我想在使用Symfony panther抓取数据时使用代理服务器。

php proxy web-scraping symfony-panther

6
推荐指数
1
解决办法
979
查看次数

react 不会在输入更改时更新功能组件状态

当我输入输入并更改时,editing.hours 不会更新输入值,但我在控制台中看到更新的值。

const nullableEntry = {
    ID: '',
    day: '',
    hours: 0.0,
    note: '',
};

const MonthTable = (props) => {
    const [editing, setEditing] = useState(nullableEntry);

    function handleHoursInput(e) {
        editing.hours = e.target.value;
        setEditing(editing);
    }

    return (
       <input type="number" value={editing.hours} step="0.01" onChange={handleHoursInput} className="form-control" name="" />
    );
};

export default MonthTable;
Run Code Online (Sandbox Code Playgroud)

javascript state functional-programming reactjs

3
推荐指数
2
解决办法
9459
查看次数