Using RegEx to clean data, there are two lines scraped, how can I get only the first line?

Comments

3 comments

  • Kara

    Hi there,

    Thank you for reaching out.

    When we are selecting this area, we can see the XPath of the data field is this:

     

    0
    Comment actions Permalink
  • Kara

    But it's getting both the title and code, so we need to clean the data with RegEx(Octoparse Regular Expression Tool

    First, let's click on "Refine extracted data".

    0
    Comment actions Permalink
  • Kara

    Then click on "Add step"

    Choose to match with this regular expression: \A.*​     which means getting the first line of data only:

     

    And here's the final result:

    0
    Comment actions Permalink

Please sign in to leave a comment.