Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #91132
| Path | csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!1.eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed2a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <joel.goldstick@gmail.com> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.006 |
| X-Spam-Evidence | '*H*': 0.99; '*S*': 0.00; 'interpreter.': 0.07; 'subject:script': 0.09; 'subject:using': 0.09; 'cc:addr:python- list': 0.10; 'python': 0.11; 'subject:python': 0.14; '23,': 0.16; 'decode': 0.16; 'selenium': 0.16; 'subject:Java': 0.16; 'wrote:': 0.16; 'basically': 0.18; 'beginner': 0.18; 'script.': 0.18; 'language': 0.19; 'prevent': 0.20; 'cc:addr:python.org': 0.21; 'trying': 0.22; 'cc:2**1': 0.22; 'java': 0.22; 'am,': 0.23; 'code,': 0.23; 'code.': 0.23; '2015': 0.23; 'for?': 0.23; 'sat,': 0.23; "i've": 0.24; 'header:In-Reply-To:1': 0.24; 'cc:addr:gmail.com': 0.24; 'developing': 0.25; 'script': 0.25; 'chris': 0.26; 'coding': 0.27; 'message-id:@mail.gmail.com': 0.28; "doesn't": 0.28; 'this.': 0.28; 'regular': 0.29; 'url:mailman': 0.31; 'code': 0.31; 'run': 0.32; 'gets': 0.32; 'embedded': 0.32; 'url:python': 0.33; 'extract': 0.33; 'this?': 0.34; 'received:google.com': 0.34; 'url:listinfo': 0.35; 'done': 0.35; 'but': 0.36; 'being': 0.36; 'url:org': 0.36; 'totally': 0.36; 'subject:: ': 0.37; 'level': 0.37; 'doing': 0.38; 'pm,': 0.39; 'some': 0.40; 'address': 0.61; 'entire': 0.61; 'here.': 0.61; 'needing': 0.63; 'virtually': 0.66; 'below:': 0.75; 'chrisa': 0.84; 'subject:source': 0.84; 'joel': 0.91 |
| DKIM-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=bty+MwdSitk9jQ9SKyofkWs5M8OXO5cFaQFM8WtVM8g=; b=w2CmMVO8OUehUiCgaQcnYwJDK8Xlo2I0U5ScBk8DpSnEye8elrc+iRZS6RyFe0e8wR 6c2uaqYnE6uttibBD/Jx6ITZ20S1rmBjsIK6C1WCWAQpGJ7IgbifABzqxQUakc9vrT24 STZfaywUfmH10skD9WDEniEyOXFVYMT/ALIvG2ZRjZbcRwa64WHOK82XuIC+2XINKRwG UgVpC3UxjvHWT+WSckZ3iYYZ05htT1O2oiKixUsKjEVcOZhJESd3/X0weGmSePSp0jM9 I4gCuxJTzSpIfjxE+9DmCQyi+dQUQTOuLeaUNpFjhL5SRQAsqWyxJBbsYpzwpbZgGbrw bQGQ== |
| MIME-Version | 1.0 |
| X-Received | by 10.107.47.216 with SMTP id v85mr17329164iov.86.1432391367372; Sat, 23 May 2015 07:29:27 -0700 (PDT) |
| In-Reply-To | <CAAXuHod4NH74+VK1EY78-vCOyiOA3879qp1uPqKOFit7qVE5sQ@mail.gmail.com> |
| References | <CAAXuHoeJ-YMQDB85qLDJ_o+9CrsfwLvm9wuOaRtbSj-i9kBaFA@mail.gmail.com> <CAPTjJmqBDu0nB2u_mf7KMpFzxxJFUqB7o-7dJiGgu-xyOL2uzg@mail.gmail.com> <CAAXuHod4NH74+VK1EY78-vCOyiOA3879qp1uPqKOFit7qVE5sQ@mail.gmail.com> |
| Date | Sat, 23 May 2015 10:29:27 -0400 |
| Subject | Re: Extract email address from Java script in html source using python |
| From | Joel Goldstick <joel.goldstick@gmail.com> |
| To | savitha devi <savithad8@gmail.com> |
| Cc | Chris Angelico <rosuav@gmail.com>, "python-list@python.org" <python-list@python.org> |
| Content-Type | text/plain; charset=UTF-8 |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.20+ |
| Precedence | list |
| List-Id | General discussion list for the Python programming language <python-list.python.org> |
| List-Unsubscribe | <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe> |
| List-Archive | <http://mail.python.org/pipermail/python-list/> |
| List-Post | <mailto:python-list@python.org> |
| List-Help | <mailto:python-list-request@python.org?subject=help> |
| List-Subscribe | <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.277.1432391369.17265.python-list@python.org> (permalink) |
| Lines | 52 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1432391369 news.xs4all.nl 2960 [2001:888:2000:d::a6]:60839 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:91132 |
Show key headers only | View raw
On Sat, May 23, 2015 at 10:15 AM, savitha devi <savithad8@gmail.com> wrote:
> What I exactly want is the java script is in the html code. I am trying for
> a regular expression to find the email address embedded with in the java
> script.
>
> On Sat, May 23, 2015 at 2:31 PM, Chris Angelico <rosuav@gmail.com> wrote:
>>
>> On Sat, May 23, 2015 at 4:46 PM, savitha devi <savithad8@gmail.com> wrote:
>> > I am developing a web scraper code using HTMLParser. I need to extract
>> > text/email address from java script with in the HTMLCode.I am beginner
>> > level
>> > in python coding and totally lost here. Need some help on this. The java
>> > script code is as below:
>> >
>> > <script type='text/javascript'>
>> > //<!--
>> > document.getElementById('cloak48218').innerHTML = '';
>> > var prefix = 'ma' + 'il' + 'to';
>> > var path = 'hr' + 'ef' + '=';
>> > var addy48218 = 'info' + '@';
>> > addy48218 = addy48218 + 'tsv-neuried' + '.' +
>> > 'de';
>> > document.getElementById('cloak48218').innerHTML += '<a ' + path + '\''
>> > +
>> > prefix + ':' + addy48218 + '\'>' + addy48218+'<\/a>';
>> > //-->
>>
>> This is deliberately being done to prevent scripted usage. What
>> exactly are you needing to do this for?
>>
>> You're basically going to have to execute the entire block of
>> JavaScript code, and then decode the entities to get to what you want.
>> Doing it manually is pretty easy; doing it automatically will
>> virtually require a language interpreter.
>>
>> ChrisA
>> --
>> https://mail.python.org/mailman/listinfo/python-list
>
>
>
> --
> https://mail.python.org/mailman/listinfo/python-list
>
I've not used it, but doesn't Selenium help do this? From what I
understand it gets the resultant html of a web page after the
javascript has run
--
Joel Goldstick
http://joelgoldstick.com
Back to comp.lang.python | Previous | Next | Find similar | Unroll thread
Re: Extract email address from Java script in html source using python Joel Goldstick <joel.goldstick@gmail.com> - 2015-05-23 10:29 -0400
csiph-web