How to access images from a HTML page - linux

how to access images from a html web page.
I am a newbie for linux and trying to learn
I have images in this location /shutterfly/web/htdocs/images
how to embed the image link in the html source code . anything I need to update in the httpd.conf file or .htaccess file
www.example.com/images/facebook.jpg
scenerio below in the source code
thanks
Raj

Can you explain you problem more nicely please.
I mean what's different in linux for adding images in html code.
We always use <a href = ""> for adding links or locations of images.
please explain your problem once more.

Related

How to scrape image in ion-img if the src is php script which is generating captcha code

I'm scraping website for the college project which will be used to display the result.
The problem is the results are protected by a captcha code.
I tried scraping using the node HTML parser but when I extract src attribute it says captcha.php.
Inspect element of that captcha code image is below
<img src="captcha.php" class="control-label ">
const img = <HTMLElement[]><any>root.querySelectorAll('img') ;
console.log(img[1]);
let imgt1 =<HTMLImageElement> img[1];
let tmp3 =JSON.stringify(imgt1.attributes);
et con1 = JSON.parse(tmp3)
console.log(con1)
this.image= con1;
console.log(this.image.src)//output captcha.php
at the front end
<ion-img [src]="image.src"></ion-img>
and the front end image is not displaying and it showing broken image
what should I do?
edit:
website also uses cookies also 'PHPSESSID'
Just because the url of the element is pointing at a php file doesn't mean it's returning a php web page.
You can write php to return any type of data you want. In this case its returning an image.
You can try downloading the captcha.php file. In theory it should have an image contents inside of it but probably it will detect that the script is not being called from the right location and show some kind of error image.
The point of a captcha is to specifically stop this kind of thing. You are a robot trying to access the system. If it was a simple case of pulling the image out via a script then it would make the captcha system pretty pointless.
When you say this is for a college project, what do you mean? Is the project to try to break a captcha system? Or are you just trying to cheat somehow?

What's the equivalent of `imagesdir` for other asset files in Asciidoctor.js?

I have a blog post written as an .adoc with my :imagesdir: set to blank (because the Hexo blogging system sets the post's relative url to the asset subfolder).
All my images load correctly, that's great. E.g.
image::patcher.png[]
But when I try to link to another file in my post's folder like
link:++animation.blend++[Blender project file]
the link is provided from the root of my site (incorrect).
How do I specify the root post folder for asset files, like I do the imagesdir folder for images please?
I asked on the github page too: https://github.com/hcoona/hexo-renderer-asciidoc/issues/9
For the moment, raw HTML is a workaround:
++++
<a href='animation.blend'>Blender project file</a>
++++

How to share html report of pytest-html with out changing the css

I am using python 3.6 and pytest-html to generate HTML reports .
Everything is successfully working but when i share my html report to my manager the css of the entire document is out of placed .can someone tell the reason to why it is happening and the solution for it .
The view of reports when i run:
The view of the reports when i share the document with my manager
include --self-contained-html when you are calling your pytest...such as
pytest your.pyfilename --html=pathandfilename --self-contained-html.
Your result file have inline css in it.
html=report.html --self-contained-html
It seems like you are not sharing whole bunch of items like CSS with html file you are giving. Just place the CSS code inside your HTML rather than giving the path and it will solve your problem.

replace hotlinked image with html code

I found out a competitor of mine copied my webpage and in the process hotlinked an image on his page - he probably just copy/pasted from the browser.
I know how to handle hotlinking, but I want to attempt a better version of it: I want to replace the http://www.mysite.invalid/image.jpg on his page with html code using htaccess so when his page with the html
<img src="http://www.mysite.invalid/image.jpg" />
would be replaced by
dontstealbandwidth.jpg"/> this image steals bandwidth from mysite.invalid<img src="dontstealbandwidth.jpg
The result in his page would then be
<img src="http://www.mysite.invalid/dontstealbandwidth.jpg"/> this image steals bandwidth from mysite.invalid<img src="dontstealbandwidth.jpg" />
I tried to redirect the image to an html file. Directly accessing the image on my site will show the content of the html file. However this does not seem to work on images inside html code.
Is this at all possible? It feels like it shouldn't be but it would be cool if it would be.
Is it at all possible to do this?
When a browser is requesting image data then you cannot return HTML text in response. You can of course make a custom image named /dontstealbandwidth.jpg with your HTML text embedded in it and redirect /image.jpg to /dontstealbandwidth.jpg using simple redirect rule like this:
RedirectMatch 301 ^/image\.jpg$ /dontstealbandwidth.jpg

How to reference layout images in express.js so that they can be found from nested directories?

I've got an express.js app currently using ejs (using jade for newer projects) and I'm trying to solve a problem in a clean and appropriate manner.
I've got a layout.ejs file with my header and footer in it. Most of my site so far has been one layer deep http://innovationbound.com/about or /services or /amy and so on....
I'm beginning to created online courses at http://innovationbound.com/courses/course-name and the issue I'm having is that these course pages can't reference the images the same way. <img src="images/linknedin.png" alt="LinkedIn Icon"> for instance.
From the course-name page it tries <img src="courses/images/LinkedIn.png" alt="LinkedIn Icon"> and obviously can't grab the image there.
Is there a setting in express, or something obvious I'm missing? I hope I don't have to use absolute urls, that just makes developing on the local machine insane.
Just use site root–relative paths. For example <img src="/images/linknedin.png" alt="LinkedIn Icon">. Note the / makes the difference.
There are three types of link paths:
Absolute paths (such as http://www.adobe.com/support/dreamweaver/contents.html).
Document-relative paths (such as dreamweaver/contents.html).
Site root–relative paths (such as /support/dreamweaver/contents.html).
From Adobe.
You might consider it, but you can use "../images/link(n?)edin.png". However, I'd recommend to use absolute path, because images should be stored in /public (in general jade setup) and your path depth could be varied by your route rule.
As a tip, if you lost in relative path of image, right click on broken image and see a URL in properties on web browser. It'll give you a hint of where the image is.

Resources