Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how to copy webpage into excel using qtp
#6
Solved: 11 Years, 3 Months, 4 Weeks ago
I have got installed QTP for only IE, here is the complete script, with no change you will get the result (Just paste this script, don't record).
Code:
CO_ID=Array(2463,3006,2498)
For k=0 To 2
Set oIE=CreateObject("InternetExplorer.Application")
oIE.Visible=True
oIE.Navigate "http://emops.tse.com.tw/server-java/t05st22_e?TYPEK=sii&step=show&co_id="&Co_ID(k)&"&year=2004"
Set desc=Description.Create()
desc("micclass").value="WebTable"
desc("text").Value="200220032004Capital structure analysis.*"
Set WebEdits=Browser("Title:=Financial Analysis").Page("Title:=Financial Analysis").ChildObjects(desc)
cCount=WebEdits(0).getROProperty("cols")
rCount=WebEdits(0).getROProperty("rows")

Set objExcel = CreateObject("Excel.Application")
objExcel.Visible = True
Set objWorkbook= objExcel.Workbooks.Open("C:\Documents and Settings\Administrator\Desktop\ForumExcel.xls")
Set objSheet=objExcel.Sheets("Sheet"&k+1)

    For i=1 To rCount
        For j=1 To cCount
        data=WebEdits(0).GetCellData(i,j)
        If (Instr(data,"analysis (%)") <> 0 OR Instr(data,"flow (%)") <> 0)Then
            objsheet.Cells(i,j).Value=data
            j=cCount
            else
            objsheet.Cells(i,j).Value=data
        End If
        Next
    Next
    objsheet.Cells(i,j).Value=CO_ID(k)
    objWorkbook.Save
    objWorkbook.Close
    objExcel.Quit
    oIE.Quit
Next

And pls et me know if it worked.
Reply


Messages In This Thread
RE: how to copy webpage into excel using qtp - by KavitaPriyaCR - 10-08-2010, 10:08 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  webpage WinObject has same name Ananthakumar_S 0 1,699 11-30-2016, 09:48 PM
Last Post: Ananthakumar_S
  Check specific links of a webpage rocky9 1 2,715 06-11-2015, 06:23 PM
Last Post: venkatesh9032
Exclamation How to verify whether pdf is completely loaded or not in webpage nmakkena 1 2,685 08-27-2014, 04:09 PM
Last Post: vinod123
  Handling .NET framework menu in webpage using QTP 10 vishnu1067 0 2,342 05-15-2014, 05:30 PM
Last Post: vishnu1067
  Comparing webtable data with weblist and webelements in other webpage arnav 1 5,816 04-18-2014, 10:01 PM
Last Post: Parke

Forum Jump:


Users browsing this thread: 3 Guest(s)