用VBA抓取IE,如何滚动到页面底部?

时间:2019-03-06 20:22:07

标签: excel vba web-scraping

我对VBA很陌生。我正在尝试滚动到网页底部。以下是网页的内容。

                string bodyText = JsonConvert.SerializeObject(message,
                    new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore });

这是我到目前为止拥有的VBA代码。

                // Build the request
            RestRequest request = new RestRequest(item.UrlPath, action);
            request.AddHeader("Content-Type", "application/json");
            request.AddHeader("Accept", "application/json");
            request.AddHeader("charset", "utf-8");
            request.RequestFormat = DataFormat.Json;

            string bodyText = JsonConvert.SerializeObject(message,
                    new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore });

            request.AddBody(bodyText);

            if (detail.baseUrl.StartsWith(@"https://"))
            {
                ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;
            }
            var tcs = new TaskCompletionSource<IRestResponse>();
            restClient.ExecuteAsync(request, response =>
            {
                tcs.SetResult(response);
            });
            dynamic garminResponse = await tcs.Task;

以某种方式不起作用。有人可以帮忙吗?

0 个答案:

没有答案