我正在抓取一个拥有Oracle ADF环回脚本的网站,该脚本不断将我重定向到我的同一页面,那么如何绕过它呢?
以下是我的PHP代码.
<?php
$url = 'https://www.mywebsite.com/faces/index.jspx';
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_COOKIEJAR, dirname(__FILE__) . '/cookie.txt');
curl_setopt($ch, CURLOPT_COOKIEFILE, dirname(__FILE__) . '/cookie.txt');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$header[] = 'User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36';
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
$data = curl_exec($ch);
curl_close($ch);
if (curl_errno($ch)) { // check for execution errors
echo 'Scraper error: ' . curl_error($ch);
exit;
}
echo $data;
?>
Run Code Online (Sandbox Code Playgroud)
当我运行上面的代码时,我被重定向到同一页面,
它还添加了一些查询字符串参数,如 ?_afrLoop=39478247795404&_afrWindowMode=0&_afrWindowId=null
在实际的网站_afrWindowId有一些随机的字母数字字符串,但我得到了null. …
我有一个以表格格式显示的数组.
我的桌子应该像这样显示
Dept: Dept 1
No Name BankCode Amount
1. Name4 656789 119.20
Dept: Dept 2
No Name BankCode Amount
1. Name 1 DREW1CF 2775.24
2. Name 2 DREW1CF 907.28
3. Name 3 EWDR1CF 318.60
Run Code Online (Sandbox Code Playgroud)
这是我的阵容
array:38 [?
0 => {#389 ?
+"FullName": "Name 1"
+"BankCode": "DREW1CF"
+"EntityName": "Dept 2"
+"amount": "2775.24"
}
1 => {#391 ?
+"FullName": "Name 2"
+"BankCode": "DREW1CF"
+"EntityName": "Dept 2"
+"amount": "907.28"
}
2 => {#392 ?
+"FullName": "Name 3"
+"BankCode": "EWDR1CF"
+"EntityName": "Dept 2" …Run Code Online (Sandbox Code Playgroud) 我正在尝试通过 desc created_time 获取具有最新订单的唯一 thread_id
这是我的表样本。
===========================================
= id = thread_id = page_id = created_time =
===========================================
= 1 = 3 = 1 = 1551162660 =
= 2 = 1 = 1 = 1551162661 =
= 3 = 1 = 1 = 1551162662 =
= 4 = 2 = 1 = 1551162663 =
= 5 = 3 = 1 = 1551162664 =
= 6 = 1 = 1 = 1551162665 =
===========================================
Run Code Online (Sandbox Code Playgroud)
这是我的代码。
DB::table('table_a')->select('thread_id')->orderBy('created_time', 'desc')->where('page_id', $page_id)->distinct()->get();
Run Code Online (Sandbox Code Playgroud)
我的代码现在的问题是,它跳过了最新的 created_time 因为不同的..
正确的做法是什么?
我正在声明一个带内联声明的变量.问题是输出结果不正确.
DATA(exact_result) = 50 * ( 2 / 5 ) .
cl_demo_output=>display( exact_result ).
Run Code Online (Sandbox Code Playgroud)
任何人都可以建议为什么结果为零,其中50*(2/5)= 20.
问候,
奥马尔阿卜杜拉
在 ATC 检查常量期间,我收到消息“字符串中缺少文本元素”。
CONSTANTS c_north TYPE c LENGTH 5 VALUE 'North'.
Run Code Online (Sandbox Code Playgroud)
如何删除“字符串中缺少的文本元素”,
请让我知道什么是最好的解决方案。
问候,
奥马尔·阿卜杜拉
php ×3
abap ×2
laravel ×2
curl ×1
distinct ×1
loopback ×1
oracle-adf ×1
sap ×1
sql-order-by ×1
web-scraping ×1