/    Sign up×
Community /Pin to ProfileBookmark

How to get FEN on an active chess.com game

I need to get FEN during a game on chess.com

Let’s consider this randomly chosen game https://www.chess.com/live#a=1377475
The FEN can be found by clicking “Share” and there on page PGN (can be seen on attached images).

  • 1. When I try to Inspect in Chrome I can see button “Share” as
    “`
    <button class=”share-button-component icon-font-chess share examine-buttons-button” tabindex=”-1″>
    ::before
    </button>
    “`
  • what confuses me since as far as I understand “::before” is linked to a class, so I am not sure how it can be inside <button> tags. Also it doesn’t have onclick() function linked to a button.

    How does this button work? How can I get FEN during a game?

    Another side question is when I try to see the page’s source and save it, I can see

    “`
    <!DOCTYPE html>
    <html
    xmlns=”http://www.w3.org/1999/xhtml”
    xml:lang=”en-US”
    lang=”en-US”
    dir=”ltr”
    xmlns:fb=”http://ogp.me/ns/fb#”
    class=” user-logged-in “>
    “`

    but when I save it I am seeing

    “`
    <!– saved from url=(0036)https://www.chess.com/live#a=1377475 –>
    <html><head><meta http-equiv=”Content-Type” content=”text/html; charset=UTF-8″></head><body><div class=”line-gutter-backdrop”></div><table><tbody><tr><td class=”line-number” value=”1″></td><td class=”line-content”><br></td></tr><tr><td class=”line-number” value=”2″></td><td class=”line-content”><br></td></tr><tr><td class=”line-number” value=”3″></td><td class=”line-content”><br></td></tr><tr><td class=”line-number” value=”4″></td><td class=”line-content”><br></td></tr><tr><td class=”line-number” value=”5″></td><td class=”line-content”><br></td></tr><tr><td class=”line-number” value=”6″></td><td class=”line-content”><br></td></tr><tr><td class=”line-number” value=”7″></td><td class=”line-content”><br></td></tr><tr><td class=”line-number” value=”8″></td><td class=”line-content”><br></td></tr><tr><td class=”line-number” value=”9″></td><td class=”line-content”><br></td></tr><tr><td class=”line-number” value=”10″></td><td class=”line-content”><br></td></tr><tr><td class=”line-number” value=”11″></td><td class=”line-content”><br></td></tr><tr><td class=”line-number” value=”12″></td><td class=”line-content”><br></td></tr><tr><td class=”line-number” value=”13″></td><td class=”line-content”><span class=”html-doctype”>&lt;!DOCTYPE html&gt;</span>
    “`

    Why does the browser encapsulate the source as html instead of saving exactly as it was shown?

    Attachments:
    [upl-image-preview url=https://www.webdeveloper.com/assets/files/2019-11-11/1573510626-762045-share2.jpeg]
    [upl-image-preview url=https://www.webdeveloper.com/assets/files/2019-11-11/1573510393-564246-tab-pgn.jpeg]

    to post a comment
    Full-stack Developer

    0Be the first to comment 😎

    ×

    Success!

    Help @kjdhgjdf spread the word by sharing this article on Twitter...

    Tweet This
    Sign in
    Forgot password?
    Sign in with TwitchSign in with GithubCreate Account
    about: ({
    version: 0.1.9 BETA 5.18,
    whats_new: community page,
    up_next: more Davinci•003 tasks,
    coming_soon: events calendar,
    social: @webDeveloperHQ
    });

    legal: ({
    terms: of use,
    privacy: policy
    });
    changelog: (
    version: 0.1.9,
    notes: added community page

    version: 0.1.8,
    notes: added Davinci•003

    version: 0.1.7,
    notes: upvote answers to bounties

    version: 0.1.6,
    notes: article editor refresh
    )...
    recent_tips: (
    tipper: @AriseFacilitySolutions09,
    tipped: article
    amount: 1000 SATS,

    tipper: @Yussuf4331,
    tipped: article
    amount: 1000 SATS,

    tipper: @darkwebsites540,
    tipped: article
    amount: 10 SATS,
    )...