LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 07-01-2014, 07:25 PM   #1
Lucien Lachance
Member
 
Registered: May 2013
Posts: 82

Rep: Reputation: Disabled
Removing adsense output


I've written a mini scraper for extracting cheat codes for my PSP. I've noticed that these tags are still in the output of the text after removing all of the tags with sed. How can I remove the unwanted output?

Unwanted Output:
Code:
<!--
google_ad_client = "ca-pub-4347670546564685";
/* 336d */
google_ad_slot = "7700751062";
google_ad_width = 336;
google_ad_height = 280;
//-->

<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
Scraper:
Code:
#!/bin/bash

wget -q -O - 'goo.gl/vfYA94' | \
  sed -En '/<strong>([1-9]|[12][0-9]|3[01])/,/<\/blockquote>/p' | \
  sed -e 's/<[^>]*>//g'
 
Old 07-01-2014, 07:34 PM   #2
Lucien Lachance
Member
 
Registered: May 2013
Posts: 82

Original Poster
Rep: Reputation: Disabled
Using this patten seems to remove it, but I'm still left with problem of that "gap" of empty space.
Code:
's/<[^>]*>//g;/</N;//ba'
Any ideas?

Last edited by Lucien Lachance; 07-01-2014 at 08:01 PM.
 
  


Reply

Tags
automation, bash



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] in removing some output parts in bash mhs2 Programming 7 06-20-2014 04:02 AM
Having a problem removing the path from the output of a variable gldetro Linux - Newbie 3 06-03-2013 11:21 AM
[SOLVED] Removing first two lines in the output of shell script laks Programming 3 02-28-2012 09:52 PM
libxml2: removing output on stdout/stderr VincOx Programming 4 07-28-2010 02:40 AM
Removing Columns From Output darthtux Programming 4 08-01-2004 09:21 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:37 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration