Selecting Multiple XPath Values

Topic Resolution: Resolved
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #2100
    Ted BTed
    Participant

    Hello – On a site I’m trying to scrape, the post content is in two locations that have a very similar XPath. Can you tell me how to combine these two so I get both the content in p in the first one and div[3] in the second one?

    /html/body/div[1]/div[2]/div/div[1]/p

    /html/body/div[1]/div[2]/div/div[1]/div[3]

    Thank you for the help!

    #2104
    Suman M.Suman M.
    Keymaster

    Hi, thanks for contacting us. Yes, you can do that. You’ll need to add a data field type custom variable, and select one part of content into it (/html/body/div[1]/div[2]/div/div[1]/div[3]) – https://www.screencast.com/t/kflYHbnGn0g0
    And in post_content data field you can assign data from /html/body/div[1]/div[2]/div/div[1]/p

    Now, click on Transform button in post_content field, goto Shortcodes tab and there you can add the Tags to merge – https://www.screencast.com/t/D53ccgWGn

    Hope this is clear. Let us know!

    #2116
    Ted BTed
    Participant

    This solution worked. Thank you for the help!

    #2117
    Suman M.Suman M.
    Keymaster

    Good to know that it’s working for you 🙂

    Regards!

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in and have valid license to reply to this topic.

License required for the following item
Login and Registration Log in · Register