火车采集器软件交流官方论坛

 找回密码
 加入会员
搜索
火车采集器V9版免费下载火车浏览器 - 可视采集,万能群发,全自动脚本工具
查看: 3887|回复: 1

请教怎样采集到javascript里面调用的内容

[复制链接]
发表于 2011-4-4 13:56:46 | 显示全部楼层 |阅读模式
1火车车厢
本帖最后由 buxuku 于 2011-4-4 22:08 编辑

比如有这样一段代码<b>软件下载统计:</b><script language="JavaScript" src="/soft/hits.asp?id=37451&type=0"></script>

其中后面统计的数字是通过javascript来调用的,如果直接打开那个页面又是什么都不显示,请问怎么通过火车头来采集到里面的内容呢?


目标页面的源代码是:
  1. <!--#include file="config.asp" -->
  2. <%
  3. Response.ContentType="text/html"
  4. Response.Expires = -9999
  5. Response.AddHeader "pragma", "no-cache"
  6. Response.AddHeader "cache-ctrol", "no-cache"

  7. Dim softid,Rs,SQL
  8. Dim AllHits,DayHits,WeekHits,MonthHits,HitsTime,hits,stype,s
  9. NewAsp.ChkPostAgent()
  10. softid=NewAsp.ChkNumeric(Request.Querystring("id"))
  11. If softid=0 Then softid=NewAsp.ChkNumeric(Request.Querystring("softid"))
  12. stype = NewAsp.ChkNumeric(Request.Querystring("type"))
  13. s = NewAsp.ChkNumeric(Request.Querystring("s"))
  14. If Not IsObject(Conn) Then ConnectionDatabase
  15. Set Rs = NewAsp.CreateAXObject("ADODB.Recordset")
  16. SQL = "SELECT AllHits,DayHits,WeekHits,MonthHits,HitsTime FROM NC_SoftList WHERE softid="& softid
  17. Rs.Open SQL,Conn,1,3
  18. If Not(Rs.BOF And Rs.EOF) Then
  19.         If s=1 Then
  20.                 hits = CLng(Rs("AllHits"))+1
  21.                 Rs("AllHits").Value = hits
  22.                 If DateDiff("Ww", Rs("HitsTime"), Now) <= 0 Then
  23.                         Rs("WeekHits").Value = Rs("WeekHits").Value + 1
  24.                 Else
  25.                         Rs("WeekHits").Value = 1
  26.                 End If
  27.                 If DateDiff("M", Rs("HitsTime"), Now) <= 0 Then
  28.                         Rs("MonthHits").Value = Rs("MonthHits").Value + 1
  29.                 Else
  30.                         Rs("MonthHits").Value = 1
  31.                 End If
  32.                 If DateDiff("D", Rs("HitsTime"), Now) <= 0 Then
  33.                         Rs("DayHits").Value = Rs("DayHits").Value + 1
  34.                 Else
  35.                         Rs("DayHits").Value = 1
  36.                         Rs("HitsTime").Value = Now
  37.                 End If
  38.                 Rs.Update
  39.         End If
  40.         AllHits = Rs("AllHits")
  41.         DayHits = Rs("DayHits")
  42.         WeekHits = Rs("WeekHits")
  43.         MonthHits = Rs("MonthHits")
  44. End If
  45. Rs.close
  46. Set Rs=nothing
  47. NewAsp.PageEnd()
  48. If stype = 1 Then
  49.         Response.Write "var oHits=document.getElementById(""NewAsp_Hits"");" & vbNewLine
  50.         Response.Write "if (oHits!=null) {" & vbNewLine
  51.         Response.Write "oHits.style.display='';" & vbNewLine
  52.         Response.Write "oHits.innerHTML="& Chr(34) &"本日:"& DayHits &" 本周:"& WeekHits &" 本月:"& MonthHits &" 总数:"& AllHits &" "& Chr(34) &";" & vbNewLine
  53.         Response.Write "}" & vbNewLine
  54. ElseIf stype = 2 Then
  55.         Response.Write "本日:"& DayHits &" 本周:"& WeekHits &" 本月:"& MonthHits &" 总数:"& AllHits
  56. ElseIf stype = 3 Then
  57.         Response.Write ""
  58. ElseIf stype = 4 Then
  59.         Response.Write "document.write (' ');"
  60. Else
  61.         Response.Write "document.write ("& Chr(34) &"本日:"& DayHits &" 本周:"& WeekHits &" 本月:"& MonthHits &" 总数:"& AllHits &" "& Chr(34) &");"
  62. End If
  63. %>
复制代码

发表于 2011-4-4 19:13:44 | 显示全部楼层
多页采集就可以了
您需要登录后才可以回帖 登录 | 加入会员

本版积分规则

QQ|手机版|Archiver|火车采集器官方站 ( 皖ICP备06000549 )

GMT+8, 2024-11-23 21:02

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

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