WordPress.org

Ready to get started?Download WordPress

Forums

WP Web Scraper
regex_replace (2 posts)

  1. adampembs
    Member
    Posted 2 years ago #

    Got the scraper to pull posts from a local news site, but the links are all relative urls, so they default to the local site. I need to replace
    <a href=" with <a href="http://www.westerntelegraph.co.uk

    thanks for any help

    Adam

    http://wordpress.org/extend/plugins/wp-web-scrapper/

  2. nothingless
    Member
    Posted 1 year ago #

    According to the manual, there's a parameter created just for that:

    basehref: A parameter which can be used to convert relative links from the scrap to absolute links. For example, basehref="http://yahoo.com", will convert all relative links to absolute by appending http://yahoo.com to all href and scr values. Note that basehref needs to be complete path (with http) and no trailing slash.

    Example:

    [wpws url="http://site.com/" basehref="http://www.westerntelegraph.co.uk" selector=".preview"]

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic