php - 我无法使用 selenium 登录星巴克
问题描述
我可以登录其他网站,但 starbucks.com 似乎很特别。该脚本永远停留在登录页面。
这是提交后的截图:
linux+php+chromedriver+facebook-php-webdriver+selenium
try{
$driver->get('https://app.starbucks.com/account/signin?ReturnUrl=https%3A%2F%2Fapp.starbucks.com%2F');
sleep(60);
$driver->takeScreenshot("s.png");
$user=$driver->findElement(WebDriverBy::id("username"));
$user->sendKeys("wild****@gmail.com");
sleep(60);
$driver->findElement(WebDriverBy::id("password"))->sendKeys("xxxx+")->submit();
sleep(60);
$driver->wait(60, 1000)->until(
WebDriverExpectedCondition::titleIs('Starbucks Coffee Company')
);
$cookies = $driver->manage()->getCookies();
print_r($cookies);````
I got a few warnings and a severe from console log, what do those mean?
[6]=>
array(3) {
["level"]=>
string(7) "WARNING"
["message"]=>
string(190) "https://jssdkcdns.mparticle.com/js/v2/2689bb1f07a4544aa30798862ab1df07/mparticle.js 28:61854 "The corresponding attribute value of nonInteraction must be a string, number, boolean, or null.""
["timestamp"]=>
int(1562331865383)
}
[7]=>
array(3) {
["level"]=>
string(6) "SEVERE"
["message"]=>
string(157) "https://assets.web.starbucksassets.com/weblx/static/signIn.7ee7f5476580837359aa.chunk.js 0:21324 Uncaught TypeError: Cannot read property 'body' of undefined"
["timestamp"]=>
int(1562331865383)
}
解决方案
推荐阅读
- sql - 相对于当前日期时间值按 +- 30 分钟分组
- xslt - 使用 XSLT 从图中剔除边
- jqgrid - 重新加载不起作用
- moodle - Moodle 中的随机错误。新见解:没有教学
- sql - 未找到列 foo 表名 - Teradata
- firebase - Xamarin FirebaseApp.InitializeApp(this) 在 60.1142.1 中返回 null
- php - Laravel 5.6 - 一对多关系
- java - 添加新数据时更新回收站视图
- json - 使用 NJsonSchema 在单元测试中解析 JSON $ref
- graphql - GraphQL 中的感叹号是什么?