Skip to content

Instantly share code, notes, and snippets.

@sysnucleus
sysnucleus / gist:f91f8b8b84d918918b6857b3a7acff3a
Created June 22, 2018 04:47
WebHarvy Amazon extraction regular expressions
src="([^_]*)_[^\.]*\.([^"]*)
<div id="feature-bullets"[^>]*>([\s\S]*?)</div>
To collect 'Title' / 'Seller' / 'In Stock'
1. Click on the required text
2. Select More Options > Capture More Content 10 times (The objective here is to get the complete HTML source of the page)
3. Select More Options > Capture HTML
4. Select More Options > Apply Regular Expression. Paste any one of following RegEx string and Apply.
id="productTitle">[\s]*([^<]*)
by[\s\S]*?id="brand"[^>]*>[\s]*([^<]*)
@sysnucleus
sysnucleus / Commonly used Regular Expressions
Last active January 30, 2022 12:00
Commonly used Regular Expressions, with WebHarvy
(.*)
Selects only first line from a block of text or HTML
[\s]*(.*)
Selects first line, ignoring the starting white-spaces, (spaces, line feeds and carriage returns).
[\s]* matches all white-spaces till the first view-able character.
href=”([^”]*)
Gets the href link/URL from HTML. [^”]* matches till the next " character.
The Man in the High Castle Kindle Edition
by
Philip K. Dick (Author)
<div class="call-to-action ">
<a title="Email" class="contact contact-main contact-email "
href="mailto:info@canberraeyelaser.com.au?subject=Enquiry%2C%20sent%20from%20yellowpages.com.au&amp;
body=%0A%0A%0A%0A%0A------------------------------------------%0AEnquiry%20via%20yellowpages.com.au%0Ahttp%3A%2F%2Fyellowpages.com.au%2Fact%2Fphillip%2Fcanberra-eye-laser-15333167-listing.html%3Fcontext%3DbusinessTypeSearch"
rel="nofollow" data-email="info@canberraeyelaser.com.au">
<span class="glyph icon-email border border-dark-blue with-text"></span><span class="contact-text">Email</span>
</a>
</div>
<div class="call-to-action ">
<a title="Website (opens in a new window)"
class="contact contact-main contact-url " href="http://www.canberraeyelaser.com.au" target="_blank" rel="nofollow">
<span class="glyph icon-website border border-dark-blue with-text"></span><span class="contact-text">Website</span>
</a>
</div>
<address>
356, Street Name, City, Country
</address>
@sysnucleus
sysnucleus / Sample Product Details Text
Last active August 29, 2015 14:24
RegEx sample Text
Product Details
Price: 99$
This product comes with absolutely no warranty . .
@sysnucleus
sysnucleus / WebHarvy Keyword List
Created July 1, 2014 11:32
WebHarvy Keyword List
<KeywordList>
<string>keyword1</string>
<string>keyword2</string>
<string>keyword3</string>
<!-- More keyword strings as required -->
</KeywordList>
<CategoryList>
<URLDATA>
<name>URL1</name>
<url>http://www.url1.com</url>
</URLDATA>
<URLDATA>
<name>URL2</name>
<url>http://www.url2.com</url>
</URLDATA>
<URLDATA>