简体   繁体   中英

Using JavaScript to prevent email address to be used by bots

Do you think that a bot will be able to send mails to the email address mentioned on the page in HTML?

Here is my code :

<h6 class="text-gray">
    <script type="text/javascript">
        var email = 'gmail.com';

        email = ('blabla.blibli' + '@' + email);

        document.write('<a href="mailto:' + email + '">' + email + '</a>');
    </script>
    <noscript>

        L'adresse mail est protégée par Javascript

    </noscript>
</h6>

This probably won't help at all. Most bots scrape pages that are fully rendered. Your JavaScript will add the email address to the page when it is rendered.

So the HTML that is seen by the browser (or in this case the bot) already contains the email address at the right place, unobfuscated. It will be easy to read.

They do not have to "parse" your JavaScript script block to get to the information.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM