1

I want to embed google classroom pages on an HTML document, such as the assigned, missing, and done pages. This is my code so far:

<div class="box classroom assigned">
         <embed width="100%" height="100%" src="https://classroom.google.com/a/not-turned-in/all"></embed>     
      </div>
      
      <div class="box classroom  missing">
         <embed width="100%" height="100%" src="https://classroom.google.com/a/missing/all"></embed>
      </div>
      
      <div class="box classroom done">
         <embed width="100%" height="100%" src="https://classroom.google.com/a/turned-in/all"></embed>     
      </div>
.box {
   display: flex;
   box-sizing: border-box;
   border: 3px solid black;
   justify-content: center;
   align-items: center;
}
.classroom {
   width: 33.333333333333333333%;
}

I just get an error that says "classroom.google.com refused to connect."

Any help is appreciated!

7
  • If you want to add Classroom resources to your website, I'd suggest using Classroom API to retrieve this data and use that instead of trying to embed the UI. What do you think of that? Also, you might find the share button useful, depending on your needs.
    – Iamblichus
    Jan 5, 2021 at 10:09
  • My goal is to simply embed the to-do, missing, and done pages. Jan 6, 2021 at 9:14
  • Do you need the UI from the Classroom, or just want to display the corresponding data? I don't think there's an easy way to embed the UI to a website (see a related question for Drive), and I'd pretty much recommend retrieving the data via API and add this data to your website.
    – Iamblichus
    Jan 6, 2021 at 11:52
  • @lamblichus All I want to do is embed the to-do, missing, and done pages so that I can view what I still need to do, what I have missing, and what was not graded yet. Thanks for your help! Jan 7, 2021 at 13:44
  • As mentioned before, I'd recommend you to use Classroom API for this. If you want to list student submissions, you can use this method. You can then filter these submissions according to their SubmissionState (field state from the resource studentSubmissions.
    – Iamblichus
    Jan 7, 2021 at 14:35

1 Answer 1

0

some sites allow embedding only from some sites or some don't even allow embedding. the site looks at the request headers to check whether it is being embedded

you should read

https://developer.mozilla.org/en-US/docs/Web/Security/CSP

https://developer.mozilla.org/en-US/docs/Web/Security/Same-origin_policy

2
  • Thanks for the info! Does this mean that there is no way for me to import information from google classroom? I tried doing it through google sheets but it didn't work, I'm assuming because you need to be signed in for this page to work. Unless there is a way to capture a screenshot of the page every 1 second and then import it to the document or something of that sort? Jan 4, 2021 at 19:18
  • i mean if you want to do something like get the user to enter their password and then fetch their details from the pages that you wanted to embed by taking a screenshot then you'll have to use webscraping for that ... i have used selenium and puppeteer but they are for browser automation which is similar to web scraping
    – codeboi
    Jan 4, 2021 at 19:32

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.