none
Copying postcode from spreadsheet into web page field, then extracting result from div title tag into spreadsheet RRS feed

  • Question

  • I have a list of about 300 postcodes in column A of my Excel document e.g.

    MK1 1AS
    MK1 1AX
    MK1 1BA
    MK1 1BB
    MK1 1BE
    MK1 1BG
    MK1 1BH
    MK1 1BJ
    MK1 1BL
    MK1 1BN
    MK1 1BP
    MK1 1BQ
    MK1 1BU

    I'm looking to automate copying/pasting them into the txtAddressSearchSingleField (i.e. the Search for an address field) on my web browser at (http://www.postcodeanywhere.co.uk/demos/address-finder) then pulling the values in the title tag in the pcaitem field.

    e.g.

    Copying in mk14 5as into the text field produces in the source code, and I want to get whatever is in the title field:

    <div class="pca pcalist">
        <div class="pcaitem pcafirstitem pcaselected" title="MK14 5AS, Canal Cottage, Great Linford, Milton Keynes">MK14 5AS, Canal Cottage, Great Linford, Milton Keynes</div>
        <div class="pcaitem" title="MK14 5AS, The Old Wharf House, Great Linford, Milton Keynes">MK14 5AS, The Old Wharf House, Great Linford, Milton Keynes</div>
        <div class="pcaitem" title="MK14 5AS, 1, The Wharf, Great Linford, Milton Keynes">MK14 5AS, 1, The Wharf, Great Linford, Milton Keynes</div>
        <div class="pcaitem" title="MK14 5AS, 3, The Wharf, Great Linford, Milton Keynes">MK14 5AS, 3, The Wharf, Great Linford, Milton Keynes</div>
        <div class="pcaitem" title="MK14 5AS, 6, The Wharf, Great Linford, Milton Keynes">MK14 5AS, 6, The Wharf, Great Linford, Milton Keynes</div>
        <div class="pcaitem" title="MK14 5AS, 9, The Wharf, Great Linford, Milton Keynes">MK14 5AS, 9, The Wharf, Great Linford, Milton Keynes</div>
        <div class="pcaitem" title="MK14 5AS, The Wharf House, 9, The Wharf, Great Linford, Milton Keynes">MK14 5AS, The Wharf House, 9, The Wharf, Great Linford, Milton Keynes</div>
        <div class="pcaitem" title="MK14 5AS, 10, The Wharf, Great Linford, Milton Keynes">MK14 5AS, 10, The Wharf, Great Linford, Milton Keynes</div>
        <div class="pcaitem" title="MK14 5AS, 11, The Wharf, Great Linford, Milton Keynes">MK14 5AS, 11, The Wharf, Great Linford, Milton Keynes</div>
        <div class="pcaitem" title="MK14 5AS, 12, The Wharf, Great Linford, Milton Keynes">MK14 5AS, 12, The Wharf, Great Linford, Milton Keynes</div>
        <div class="pcaitem pcalastitem" title="MK14 5AS, Ash House, The Wharf, Great Linford, Milton Keynes">MK14 5AS, Ash House, The Wharf, Great Linford, Milton Keynes</div>
    </div>

    How would I go about doing this?

    Is there a better way of doing this?

    Thursday, July 24, 2014 10:10 PM

Answers

  • Hi,

    According to your description, you want to copy and paste the data form an Excel workbook into a Web page.

    In fact, to achieve the goal, you have to upload the workbook to the server side of your Web application, and then pick out the data from the Excel workbook to fill them into the innerText of the related HTML tabs such as "txtAddressSearchSingleField".

    But to get the data from Excel workbook in server side, we cannot resort to Excel Object Model. Because Microsoft does not currently recommend, and does not support, Automation of Microsoft Office applications from any unattended, non-interactive client application or component (including ASP, ASP.NET, DCOM, and NT Services), because Office may exhibit unstable behavior and/or deadlock when Office is run in this environment.

    Microsoft strongly recommends a number of alternatives that do not require Office to be installed server-side. Open XML SDK is a good alternatives. It can be used to manipulate all the Open XML format file. Form Office 2007, all the Office documents are Open XML format. So if your workbook is a .xlsx file, you could resort to Open XML SDK in the server side to get data. More details please refer to Considerations for server-side Automation of Office.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, July 25, 2014 9:34 AM
    Moderator

All replies

  • Hi,

    According to your description, you want to copy and paste the data form an Excel workbook into a Web page.

    In fact, to achieve the goal, you have to upload the workbook to the server side of your Web application, and then pick out the data from the Excel workbook to fill them into the innerText of the related HTML tabs such as "txtAddressSearchSingleField".

    But to get the data from Excel workbook in server side, we cannot resort to Excel Object Model. Because Microsoft does not currently recommend, and does not support, Automation of Microsoft Office applications from any unattended, non-interactive client application or component (including ASP, ASP.NET, DCOM, and NT Services), because Office may exhibit unstable behavior and/or deadlock when Office is run in this environment.

    Microsoft strongly recommends a number of alternatives that do not require Office to be installed server-side. Open XML SDK is a good alternatives. It can be used to manipulate all the Open XML format file. Form Office 2007, all the Office documents are Open XML format. So if your workbook is a .xlsx file, you could resort to Open XML SDK in the server side to get data. More details please refer to Considerations for server-side Automation of Office.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, July 25, 2014 9:34 AM
    Moderator
  • Can you suggest any other way of doing this?
    Friday, July 25, 2014 12:52 PM
  • Hi,

    >>Can you suggest any other way of doing this?<<

    As far as I know, it's hard to find another way.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, July 28, 2014 8:56 AM
    Moderator