ExcelHome技术论坛

 找回密码
 免费注册

QQ登录

只需一步,快速开始

快捷登录

搜索
EH技术汇-专业的职场技能充电站 妙哉!函数段子手趣味讲函数 Excel服务器-会Excel,做管理系统 效率神器,一键搞定繁琐工作
HR薪酬管理数字化实战 Excel 2021函数公式学习大典 Excel数据透视表实战秘技 打造核心竞争力的职场宝典
让更多数据处理,一键完成 数据工作者的案头书 免费直播课集锦 ExcelHome出品 - VBA代码宝免费下载
用ChatGPT与VBA一键搞定Excel WPS表格从入门到精通 Excel VBA经典代码实践指南
楼主: mail249120

[求助] VBA抓取网页表格数据

[复制链接]

TA的精华主题

TA的得分主题

发表于 2020-8-8 17:01 | 显示全部楼层
duquancai 发表于 2019-1-23 20:22
有:用户名及密码 好说!直接上代码》》》》》》》》》》》》》》》》》》》》

大神,还在线吗

TA的精华主题

TA的得分主题

发表于 2020-12-15 17:59 | 显示全部楼层
duquancai 发表于 2019-1-23 20:22
有:用户名及密码 好说!直接上代码》》》》》》》》》》》》》》》》》》》》

大神能帮我弄一个嘛

TA的精华主题

TA的得分主题

发表于 2020-12-18 08:25 | 显示全部楼层
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件       ★免费下载 ★       ★ 使用帮助
duquancai 发表于 2019-1-23 20:22
有:用户名及密码 好说!直接上代码》》》》》》》》》》》》》》》》》》》》

高手,能加你好友吗,我想请教你关于正确云教育平台https://www.zqy.com/批量下载试卷的爬虫的问题。

TA的精华主题

TA的得分主题

发表于 2020-12-18 14:33 | 显示全部楼层
chinazrm 发表于 2020-12-18 08:25
高手,能加你好友吗,我想请教你关于正确云教育平台https://www.zqy.com/批量下载试卷的爬虫的问题。

兄弟,需要登录的

TA的精华主题

TA的得分主题

发表于 2020-12-19 22:00 | 显示全部楼层
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用  · 内置多项VBA编程加强工具       ★ 免费下载 ★      ★使用手册
学习学习中

TA的精华主题

TA的得分主题

发表于 2020-12-19 22:39 | 显示全部楼层

TA的精华主题

TA的得分主题

发表于 2022-5-1 22:21 | 显示全部楼层

TA的精华主题

TA的得分主题

发表于 2024-3-9 22:33 | 显示全部楼层
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用  · 内置多项VBA编程加强工具       ★ 免费下载 ★      ★使用手册

请教大神以下网站数据如何抓取?
http://ddx.gubit.cn/sz0.php
http://ddx.gubit.cn/sh0.php
http://ddx.gubit.cn/cyb.php
http://ddx.gubit.cn/new2.html
以下是数据源
http://ddx.gubit.cn/ygetszddxpm. ... =0.6813226370393328
{"data":[["002873","10.55","10.01","0.230","0.125","11578.557","-0.435","-3.897","1.458","5.557","6","1","542.93","947.52","57.3"],["002902","25.86","10.00","5.253","5.098","10770.704","4.301","-6.345","5.240","-49.865","3","1","20896.68","32148.74","65.0"],["002613","4.09","9.95","2.465","1.514","300.068","2.265","-0.026","-1.419","-13.139","5","1","6032.25","10224.16","59.0"],["000504","8.78","10.03","0.638","0.268","270.591","0.874","1.326","1.365","6.225","4","1","1726.55","3215.18","53.7"],["002313","9.63","10.06","4.276","3.062","169.110","4.698","-2.816","0.956","-47.602","5","1","15347.91","28741.41","53.4"],["002907","14.69","10.04","1.316","1.027","156.901","1.199","0.390","0.686","-8.077","3","1","5920.94","10944.43","54.1"],["002575","6.79","10.05","1.245","0.949","134.820","1.007","1.342","-1.174","-0.400","5","1","4787.48","13225.07","36.2"],["002775","2.84","10.08","1.039","1.161","105.975","1.213","-0.195","2.594","-8.304","3","2","1284.42","5076.77","25.3"],["001208","9.24","10.00","2.194","1.660","86.682","4.990","1.092","5.537","-10.008","5","3","4946.28","17602.40","28.1"],["002632","8.21","10.05","2.581","2.332","76.910","-0.275","1.983","-6.248","-16.828","6","1","11884.37","34150.49","34.8"],["002298","4.77","9.91","1.391","1.602","74.502","0.910","3.272","-1.332","-7.998","4","1","4161.85","16450.00","25.3"],["002599","6.45","10.07","4.535","5.132","71.281","5.281","11.392","4.648","-5.830","6","1","11387.03","32627.59","34.9"],["002087","1.30","4.84","0.349","0.711","70.189","-0.988","-2.291","-0.029","-0.316","0","2","367.38","1818.72","20.2"],["003004","22.75","10.01","1.380","0.605","66.010","1.835","1.557","2.150","-5.687","4","2","2144.98","6682.17","32.1"],["000815","10.09","10.03","2.204","1.568","62.974","1.822","0.173","-3.823","-22.557","2","1","14741.71","38896.33","37.9"],["000411","10.89","10.00","1.235","0.770","62.070","1.028","0.803","0.452","2.456","2","1","4212.10","14831.33","28.4"],["002388","4.50","6.13","1.288","3.420","56.003","1.128","1.768","0.001","-10.866","5","1","2915.09","17351.72","16.8"],["002793","4.52","9.98","0.544","0.371","51.094","0.561","0.476","2.295","2.262","5","1","2604.18","11945.79","21.8"],["000861","1.46","0.00","0.241","0.619","48.301","0.544","0.381","-3.005","-14.638","4","3","843.67","6203.45","13.6"],["002181","4.19","0.72","0.259","0.816","47.863","0.140","1.076","0.105","-9.027","6","2","1228.21","6978.45","17.6"]],"updatetime":"2024-03-08 15:00:00","total":1500,"page":1,"nowdate":"2024-03-09"}
以下脚本是我几年以前下载同样网站数据抓取的(忘记了作者名字),最近因为散户大家庭的数据经常断更没有更新,才想起来以前有这么一个文件,以前是可以运行抓取到数据的,现在发现脚本失效了,看看哪位大神能帮忙修改一下?脚本如下:
Sub 查股网个股历史DDX数据1()
    On Error Resume Next
    Columns("A:A").NumberFormatLocal = "@"
    [a1:x1] = Split("代码,开盘(元),收盘(元),最高,最低,涨幅,成交量(万元),通吃率,BBD(万元),DDX,DDX3日,DDX5日,DDX10日,DDX60日,DDY,单数比,小单差,小单流入(万元),中单差,中单流入(万元),大单差,大单流入(万元),特大单差,特大单流入(万元)", ",")
    Dim temp
    With CreateObject("Microsoft.XMLHTTP")
        .Open "GET", "http://ddx.gubit.cn/js/astocksuggest.js" & p, True
        .Send
        Do Until .ReadyState = 4
            DoEvents
        Loop
        temp = Split(.responsetext, "~")
        With CreateObject("internetexplorer.application")
            .Visible = True
            For k = 1 To UBound(temp)
                .Navigate "http://ddx.gubit.cn/ddelist.html?code=" & Format(Split(temp(k), "`")(0), "000000") & "&bdate=2012-09-14&edate=2012-09-27"
                Do Until .ReadyState = 4
                    DoEvents
                Loop
                n = Range("b65536").End(xlUp).Row
                Set r = .Document.getElementByid("sjtableright").Rows
                For i = 1 To r.Length - 2
                    For j = 0 To r(i).Cells.Length - 1
                        Cells(i + n, j + 2) = r(i).Cells(j).innerText
                    Next j
                Next i
                m = Range("b65536").End(xlUp).Row
                Range(Cells(n + 1, 1), Cells(m, 1)) = Format(Split(temp(k), "`")(0), "000000")
                Set r = Nothing
            Next k
            .Quit
        End With
    End With
    Cells.Font.Size = 9
    Cells.Columns.AutoFit
End Sub
您需要登录后才可以回帖 登录 | 免费注册

本版积分规则

手机版|关于我们|联系我们|ExcelHome

GMT+8, 2024-11-17 20:24 , Processed in 0.031631 second(s), 6 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4

© 1999-2023 Wooffice Inc.

沪公网安备 31011702000001号 沪ICP备11019229号-2

本论坛言论纯属发表者个人意见,任何违反国家相关法律的言论,本站将协助国家相关部门追究发言者责任!     本站特聘法律顾问:李志群律师

快速回复 返回顶部 返回列表