|
网址为:http://www.iwencai.com/unifiedwap/result?w=五粮液撑压线&querytype=stock
其中 五粮液 为需要更换的。
代码如下:
- Dim xmlHttp As Object
- Set xmlHttp = CreateObject("MSXML2.ServerXMLHTTP.6.0")
- key = "五粮液"
- wz = "http://www.iwencai.com/unifiedwap/result?w=" + Application.WorksheetFunction.EncodeURL(key + "撑压线") + "&querytype=stock"
- xmlHttp.Open "GET", wz, False
- xmlHttp.Send
- '等待响应
- Do While xmlHttp.readyState < 4
- DoEvents
- Loop
- '响应结果
- Dim strText As String
- strText = xmlHttp.responseText
- Debug.Print (strText)
复制代码 获取的没有相关五粮液的数据,却是下面的代码,没有我想要的数据,请问怎么才能获取到我想要的 撑压线 数据
</noscript>
<script>
// 移动设备跳转wap首页的逻辑
(function(){
var getParamByName = function(paramName, decodeFlag, url) {
var paramReg = new RegExp("[?&]"+paramName+"=([^&#]+)");
decodeFlag = typeof decodeFlag === "boolean" ? decodeFlag : false;
var tagUrl = url || window.location.href;
var matchRes = tagUrl.match(paramReg);
var tagVal = matchRes ? matchRes[1] : "";
if (tagVal && decodeFlag) {
tagVal = decodeURIComponent(tagVal);
}
return tagVal;
};
var getParamStrArr = []; // 需要添加的get参数字符串数组
var hashParamStrArr = []; // 需要添加的hash参数字符串数组
// 问句和领域参数逻辑 wap项目会将下边带问句、领域参数的状况转换到/result路由下的对应参数的逻辑上去
var wParamValue = getParamByName("w");
var querytypeParamValue = getParamByName("querytype");
if (wParamValue) {
getParamStrArr.push('q=' + wParamValue);
if (querytypeParamValue) {
getParamStrArr.push('queryType=' + querytypeParamValue);
}
}
// from 参数逻辑
var fromParamValue = getParamByName("from");
if (fromParamValue) {
getParamStrArr.push('from=' + fromParamValue);
}
// 分享助力assistId 参数逻辑
var assistIdParamValue = getParamByName("assistId");
if (assistIdParamValue) {
hashParamStrArr.push('assistId=' + assistIdParamValue);
}
// 分享攒次数hostUserId 参数逻辑
var hostUserIdParamValue = getParamByName("hostUserId");
var shareTsParamValue = getParamByName("shareTs");
if (hostUserIdParamValue && shareTsParamValue) {
hashParamStrArr.push('hostUserId=' + hostUserIdParamValue);
hashParamStrArr.push('shareTs=' + shareTsParamValue);
}
// 首页地址拼接
var mobileUrl = location.protocol + "//" + location.host;
mobileUrl += "/unifiedmobile/";
// get参数拼接逻辑
if (getParamStrArr.length > 0) {
mobileUrl += "?" + getParamStrArr.join("&");
}
// hash参数拼接逻辑
if (hashParamStrArr.length > 0) {
mobileUrl += "#/?" + hashParamStrArr.join("&");
}
var ua = navigator.userAgent;
if (/iPhone|iPod|webOs|BlackBerry|Window Phone|Android|Mobile/i.test(ua) || window.innerWidth <= 768) {
// 当视口宽度小于768时跳转移动版问财,768取值于body标签的min-width属性
window.location.href = mobileUrl;
}
})();
</script>
<div id="app"></div>
<script type="text/javascript" src="//s.thsi.cn/cb?;iwencai/js/lib/vuejs/2.5.16/vue.min.js;/js/;jquery-1.8.3-assign.min.js;sso_https.min.js;vue-paginate-1.9.3.js;ta_https_1.2.min.js;common/cefapi/1.5.1/cefApi.min.js;js/m/v2.10/business/;stat.js" crossorigin=""></script>
<!-- built files will be auto injected -->
<script>
// 低版本IE浏览器(IE10及以下)提示升级和跳转旧版的弹层脚本
function checkLowerBrowser() {
var userAgent = window.navigator.userAgent.toLowerCase();
var msieVersionReg = /msie\s*([0-9.]+)/i;
var tridentVersionReg = /trident\/[0-9.]+.*rv\:([0-9.]+)/i;
var msieMatchRes = userAgent.match(msieVersionReg);
var tridentMatchRes = userAgent.match(tridentVersionReg);
var curIEVersion = -1;
if (msieMatchRes) {
curIEVersion = parseInt(msieMatchRes[1]);
} else if (tridentMatchRes) {
curIEVersion = parseInt(tridentMatchRes[1]);
}
if (curIEVersion > 0 && curIEVersion < 11) {
var cssString= [
'.less-than-ie-box { position: fixed; z-index: 999; box-sizing: border-box; top: 50%; left: 50%; width: 500px; height: 296px; margin-left:-250px; margin-top:-148px; padding: 20px; background: #fff; border: 1px solid #eaeaea; box-shadow: 0 2px 6px 0 rgba(0, 0, 0, 0.2); color: #1E2024;}',
'.less-than-ie-box .close { position: absolute; top: 10px; right: 18px; width: 20px; height: 20px; background: url("//i.thsi.cn/iwencai/pcwencai/icon-merge.png") no-repeat -8px -42px; cursor: pointer; }',
'.less-than-ie-box .close:hover{ background: url("//i.thsi.cn/iwencai/pcwencai/icon-merge.png") no-repeat -40px -42px; }',
'.less-than-ie-box .title { font-size: 20px; text-align: center; margin: 8px 0 20px; }',
'.less-than-ie-box .tip { margin-bottom: 10px; font-size: 16px; text-align: left; line-height: 30px; }',
'.less-than-ie-box .download { height: 66px; padding: 20px 50px; }',
'.less-than-ie-box .download a { display: inline-block; width: 62px; height: 62px; margin: 0 30px;}',
'.less-than-ie-box .ie { background: url("//i.thsi.cn/iwencai/pcwencai/ie.png") no-repeat;}',
'.less-than-ie-box .chrome { background: url("//i.thsi.cn/iwencai/pcwencai/chrome.png") no-repeat;}',
'.less-than-ie-box .ps { margin-top: 14px; font-size: 14px; color: #999; text-align: left;}',
'.less-than-ie-box .old-link { float: right; color: #1570E8;}'
].join("");
var styleElem = document.createElement("style");
styleElem.type = 'text/css';
if (styleElem.styleSheet) {
styleElem.styleSheet.cssText = cssString;
} else {
var cssText = document.createTextNode(cssString);
styleElem.appendChild(cssText);
}
document.getElementsByTagName("head")[0].appendChild(styleElem);
var appendHtml = [
'<div class="less-than-ie-box" id="less_then_ie_box">',
'<h6 class="title">是时候升级浏览器了 </h6>',
'<p class="tip">您当前的浏览器版本过低,为了更好的体验我们的服务,建议升级您的浏览器~</p>',
'<p class="download">',
'<a href="//jingyan.baidu.com/article/0eb457e5e7797403f1a90520.html" class="ie" target="_blank"></a>',
'<a href="//www.google.cn/chrome/" class="chrome" target="_blank"></a>',
'</p>',
'<p class="ps">*点击图标,即可进入对应浏览器升级哦~<a id="old_link" class="old-link">返回旧版</a></p>',
'<i class="close" id="less_then_ie_box_close_btn"></i>',
'</div>'
].join("");
document.body.insertAdjacentHTML('beforeend',appendHtml);
function setCookie(name, value, expiresTime) {
var defaultExpiresTime = 10 * 12 * 30 * 24 * 60 * 60 * 1000; // 默认十年有效期
var expiresDate = new Date();
var expiresTimestamp = expiresDate.getTime() + defaultExpiresTime;
expiresDate.setTime(expiresTimestamp);
document.cookie = name + '=' + value + ';expires=' + expiresDate.toGMTString() + ';path=/';
}
function getCookie(key) {
var arr1 = document.cookie.split(";");
try {
for (var i = 0; i < arr1.length; i++) {
var arr2 = arr1.split("=");
if (arr2[0].replace(/(^\s+)|(\s+$)/g, '') === key) {
return decodeURIComponent(arr2[1]);
}
}
} catch (e) {
}
return null;
}
function clickOldLink() {
var userid = getCookie('userid');
var href = window.location.protocol + '//' + window.location.host;
setCookie("wencai_pc_version", "0");
if (userid) {
$.ajax({
url: "/iwencai/userinfo/iwc/userinfo/pc/version/save/",
type: "POST",
data: JSON.stringify({
user_id: String(userid),
version: "0",
}),
contentType: "application/json",
complete: function() {
window.location.href = href;
}
});
}
setTimeout(function() {
window.location.href = href;
}, 1000);
}
var oldLink = document.getElementById('old_link');
oldLink.addEventListener('click', clickOldLink);
function closePopBox() {
var popBox = document.getElementById("less_then_ie_box");
popBox.style.display = 'none';
}
var closeBtn = document.getElementById("less_then_ie_box_close_btn");
if (window.attachEvent) {
closeBtn.attachEvent("onclick", closePopBox);
} else {
closeBtn.addEventListener("click", closePopBox);
}
}
}
if (window.attachEvent) {
window.attachEvent("onload", checkLowerBrowser);
} else {
window.addEventListener("load", checkLowerBrowser);
}
</script>
<script type="text/javascript" src="//s.thsi.cn/cb?cd/iwc-web-result-red-rabbit-project/unifiedwap/static/3.44.0/js/chunk-vendors.4a95d2a1.js" crossorigin=""></script>
<script type="text/javascript" src="//s.thsi.cn/cb?cd/iwc-web-result-red-rabbit-project/unifiedwap/static/3.44.0/js/chunk-common.67215c1e.js" crossorigin=""></script>
<script type="text/javascript" src="//s.thsi.cn/cb?cd/iwc-web-result-red-rabbit-project/unifiedwap/static/3.44.0/js/index.9ea5037b.js" crossorigin=""></script>
<script>if("serviceWorker" in navigator){
window.addEventListener('load', function(){
navigator.serviceWorker
.register("/unifiedwap/serviceWorker.js?version=3.44.0&projectName=wencaiweb")
})
}</script>
</body>
</html>
|
|