Linked Questions

Popular Questions

How to search in website html via python-3.6?

Asked by At

i have lot of gifts and i need create checker, that will check, if is the gift working or not --> it will search in html for some words. Im looking for "gift code invalid"

When i try to read html via urllib or requests, it will only load a small part of html. Im beginner, so im maybe doing something wrong.

my code is:

import requests
link = "https://discord.gift/o2uzOR7YE3CoBpGq"
r = requests.get(link)
print(r.text)

output is:

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8" />
    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1, user-scalable=no" name="viewport" />

    <!-- section:seometa -->
    <meta property="og:type" content="website" />
    <meta property="og:site_name" content="Discord" />
    <meta property="og:title" content="Discord - Free voice and text chat for gamers" />
    <meta
      property="og:description"
      content="Step up your game with a modern voice & text chat app. Crystal clear voice, multiple server and channel support, mobile apps, and more. Get your free server now!"
    /><meta property="og:image" content="https://discordapp.com/assets/ee7c382d9257652a88c8f7b7f22a994d.png" />    <meta name="twitter:card" content="summary_large_image" />
    <meta name="twitter:site" content="@discordapp" />
    <meta name="twitter:creator" content="@discordapp" />
    <!-- endsection -->

    <link
      rel="chrome-webstore-item"
      href="https://chrome.google.com/webstore/detail/lcbhdgefieegnkbopmgklhlpjjdgmbog"
    />
<link rel="stylesheet" href="/assets/0.830216ebaf585f92a484.css" integrity="sha256-qzZED1N67NuVMyWOdvhIGhtLtKnOXSg+F3HcanmdW4Q= sha512-D0iS5hrftKNpXWnvjpfujnvlabUq6K5gsHbsdvctRMtQXzdf2jvZ/JwaRHAPSb9Z5Xb2o8SBeXeMTajvtrkeRw=="><link rel="icon" href="/assets/07dca80a102d4149e9736d4b162cff6f.ico" />    <!-- section:title -->
    <title>Discord</title>
    <!-- endsection -->
  </head>

  <body>
    <div id="app-mount"></div><script nonce="NjksMjM0LDU4LDI4LDkxLDUxLDYzLDE3Mg==">window.__OVERLAY__ = /overlay/.test(location.pathname)</script><script nonce="NjksMjM0LDU4LDI4LDkxLDUxLDYzLDE3Mg==">window.GLOBAL_ENV = {
      API_ENDPOINT: '//discordapp.com/api',
      WEBAPP_ENDPOINT: '//discordapp.com',
      CDN_HOST: 'cdn.discordapp.com',
      ASSET_ENDPOINT: 'https://discordapp.com',
      WIDGET_ENDPOINT: '//discordapp.com/widget',
      INVITE_HOST: 'discord.gg',
      GIFT_CODE_HOST: 'discord.gift',
      MARKETING_ENDPOINT: '//discordapp.com',
      NETWORKING_ENDPOINT: '//router.discordapp.net',
      RELEASE_CHANNEL: 'stable',
      BRAINTREE_KEY: 'production_5st77rrc_49pp2rp4phym7387',
      STRIPE_KEY: 'pk_live_CUQtlpQUF0vufWpnpUmQvcdi',
    };</script><script nonce="NjksMjM0LDU4LDI4LDkxLDUxLDYzLDE3Mg==">!function(){if(null!=window.WebSocket){var n=function(n){try{var e=localStorage.getItem(n);return null==e?null:JSON.parse(e)}catch(n){return null}},e=n("token"),o=n("gatewayURL");if(e&&o){var r=null!=window.DiscordNative||null!=window.require?"etf":"json",t=o+"/?encoding="+r+"&v=6";void 0!==window.Uint8Array&&(t+="&compress=zlib-stream"),console.log("[FAST CONNECT] "+t+", encoding: "+r+", version: 6");var a=new WebSocket(t);a.binaryType="arraybuffer";var i=Date.now(),s={open:!1,gateway:t,messages:[]};a.onopen=function(){console.log("[FAST CONNECT] connected in "+(Date.now()-i)+"ms"),s.open=!0},a.onclose=a.onerror=function(){window._ws=null},a.onmessage=function(n){s.messages.push(n)},window._ws={ws:a,state:s}}}}();</script><script src="/assets/294f56f239ff22f62fc1.js" integrity="sha256-wTRQJKoqMfG3makS9dDuuegpcHSdaGmfoEBQUPXMdDM= sha512-OVrPyjx2akoJ6QS8OZ+9blz/ADtDHruxw4gwLsjfDVUgolO1ZtcgWbOo0Zj9JBNyzAjKOSCfoFoN9lnkF0EYCw=="></script><script src="/assets/eaa48b00154d2e7ac545.js" integrity="sha256-FRTrm1gL5gkDUoKwVuL9hrrmllKXQsZg7r5zy0Xo4bo= sha512-QZ4c5JQKE5rLJf1uGLQaHHL4NpkAigt4TtluicuMZDYDE5fiL7wkaD2CMBxr0xhOO5aNfSFCxcaqBkU/xOEggQ=="></script><script src="/assets/c73d229b094bb39f0686.js" integrity="sha256-thaBLLvK6Up+B8O7zIOF9Uv8IF+gwGuOW+WUe26l/vk= sha512-5ez2fLO3oMI1UPZDif1Szfjwz04ftTNfhWWSqM81hNhuVN7kckAAZR5a1SuQG8rgsqXwN1is53uAL5M2rz/FOg=="></script>  </body>
</html>

you can see in first picture, there is text "gift code invalid" in html of that site, but this string is not in python output.

https://ctrlv.cz/kKd3

Related Questions