嗨,我正在尝试从 javascript onclick 中获取确切的值。
这是我的示例链接:
onclick="omniture('Touchpad_8.0.7.2.ZIP','NP-N150P');downloadFile('http://xxx.com/downloadfile/ContentsFile.aspx?CDSite=UNI_CO&CttFileID=3017288&CDCttType=DR&ModelType=N&ModelName=NP-N150P&VPath=DR/201105/20110509115437867/Touchpad_8.0.7.2.ZIP','ZIP');return false;"
Lan o red inalambrica BROADCOM - 5.100.82.95 - onclick="omniture('WLAN_Broadcom_5.100.82.95.ZIP','NP-N150P');downloadFile('http://xxx.com/downloadfile/ContentsFile.aspx?CDSite=UNI_CO&CttFileID=3017290&CDCttType=DR&ModelType=N&ModelName=NP-N150P&VPath=DR/201108/20110817201634927/WLAN_Broadcom_5.100.82.95.ZIP','ZIP');return false;"
这是我正在尝试的:
preg_match_all(
"~onclick\s*=\s*([\"\'])(.*?)\\1~si", $d_l, $match);
$link = $match[0][0];
我得到完整的 onclick 不是确切的值,我想获得链接作为输出:
(
http://xxx.com/downloadfile/ContentsFile.aspx?CDSite=UNI_CO&CttFileID=3017290&CDCttType=DR&ModelType=N&ModelName=NP-N150P&VPath=DR/201108/20110817201634927/WLAN_Broadcom_5.100.82.95.ZIP)
有人可以帮忙吗?