Python Parsing with js script src - javascript

I am trying to parse Ekonika, but when I am doing basic requests get, it gives me:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta name="referrer" content="no-referrer" />
<script src="/__qrator/qauth_utm_v2.js"></script>
</head>
<body>
</body>
</html>
I cant really get where information is? When I am adding "/__qrator/qauth_utm_v2.js" to the link it says The page is forbidden.
Can you please advice the right way to parse it?

Related

Chrome extension override

I have a chrome extension that I found online. I am trying to put a link to my website in the override file but I am unsure how to do it. If anyone would know how it would be greatly appreciated.
<!DOCTYPE html>
<html>
<head>
<title>Cape Breton's Homepage</title>
</head>
<body>
script/code would go here
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<title>Cape Breton's Homepage</title>
</head>
<body>
Your Website
</body>
</html>

Facebook post embed renders but isn't showing up

I'm trying to get the Facebook Post embed working on my own site using their JS SDK but it doesn't seem to show up.
Some inline styles on the embedded iframe and the span it encapsulates it, controls the display of the widget.
I found some hacks but they aren't perfect. I used facebook's JS playground on the same code and it works.
There aren't any stylesheet interfering with this file and no extension as well as I checked in firefox and the result was the same.
edit: posting the code here:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<body>
<script src="https://connect.facebook.net/en_GB/sdk.js#xfbml=1&version=v2.12" async></script>
<div class="fb-post" data-href="https://www.facebook.com/20531316728/posts/10154009990506729/" data-width="500"></div>
</body>
</html>
Kindly see the photo attachment.
Thanks
P.S. Facebook code is directly copied from their docs, HERE
I assume you tried this by just opening the HTML file in your browser. You have to open it using a local or remote server. If i start it with a local server with the exact same code, it works perfectly fine.
For example: https://www.npmjs.com/package/http-server

Strange behaviour with Unexpected token ILLEGAL Error

I'm facing very strange behaviour in Chrome & Mozilla from jQuery. I'm getting very generic Unexpected token ILLEGAL error on my document.ready function.
While playing with a signaturepad sample, I tried it with my own page. It is not working in Mozilla & Chrome, but is working in IE. Then I removed all references of signaturepad and put a simple one alert inside document.ready function and observed (Thanks to Chrome JavaScript Errors Notifier) Unexpected token ILLEGAL error is occurring when system try to use jQuery reference. Then I copied all the text from the sample page (a.html), where it works perfectly inside this page (b.html), and ran the page again. I'm surprised the a.html page is working fine while b.html page is throwing the error. Both pages are on the same directory and have the same content.
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<title> </title>
<link rel="stylesheet" href="css/jquery.mobile-1.3.1.min.css">
<link href="css/jquery.signaturepad.css" rel="stylesheet">
<script src="js/jquery-1.9.1.min.js"></script>
<script src="js/jquery.mobile-1.3.1.min.js"></script>
</head>
<body>
<script>
$(document).ready(function () {
alert('hai');
})
</script>
</body>
</html>
Problem fixed now. Issue was in Encoding through which file was saved. The problematic file was saved with Unicode-1200 while it should be saved with Unicode-65001.
Thanks all for answering/comments.
Regards
I would do a few things that may sound silly --
Add a <!DOCTYPE html> tag to the top -- jquery mobile likes it
remove the indentation in front of your <html lang="en"> tag
redownload or try to use a hosted jquery library (e.g. from google) to see if that's it
add a closing ; after your })

d3.js doesn't work for some reason

I'm trying to understand d3 via this tutorial
So, I've downloaded script, named it d3.js and put it in the same directory with index.html
Here is code of index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>D3 Test</title>
<script type="text/javascript" src="d3.js"></script>
<style type="text/css"></style>
</head>
<body>
<script type="text/javascript">
d3.select("body").append("p").text("New paragraph!");
</script>
</body>
</html>
However, when I load page, I don't see a new paragraph? What is wrong?
The snippet below is how jsFiddle sets up a working, d3-enabled page. I am not sure what exactly causes your problem, but maybe you could try copying the header.
I generally recommend including libs, like d3, via a CDN (e.g. cloudflare, or d3's own server, as in the fiddle), since the cached version can then be used across site domains (due to its absolute link), without being downloaded every time.
<html><head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title> - jsFiddle demo</title>
<script type="text/javascript" src="http://d3js.org/d3.v3.min.js"></script><style type="text/css"></style>
<link rel="stylesheet" type="text/css" href="/css/result-light.css">
<script type="text/javascript">//<![CDATA[
window.onload=function(){
d3.select("body").append("p").text("New paragraph!");
}//]]>
</script>
</head><body></body></html>
You can keep your script tag at the bottom of the body though.

IE ignores my js

I have validated this html. When I open it in a IE browser I cant see any alert. In other browsers I can. Any ideas why this is happening. HTML is valid according to http://validator.w3.org/check.
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/1998/REC-html40-19980424/loose.dtd">
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>hello</title>
</head>
<body>
<script type="text/javascript">alert("hallo");</script>
<div>Hello</div>
</body>
</html>
If you are opening the file locally in IE, you will a find confirmation message from IE saying
"Allow blocked content"
Click on it and your code will run.

Categories