PowerShell: Modify HTML website - html

I saved a copy of a webpage via powershell (IE com-object) and now I would like to modify the source code. I would like to remove the first row of the table (TR-TAG), see source code at: http://pastebin.com/kqfQUsHR (see line 17 and 44).
How can I accomplish this in powershell?

I think he wants to change the HTML code of the webpage, to fix the double table border between the header and the page itself (remove the TR tag).
Patrick, if that is what you want to fix, your web pages are build dynamically (php), so you need to change this in the php script that makes the web page(arbeitsblatt.php).

Related

How to edit the HTML code of just one page of my wordpress website?

So for some pages of my Wordpress website I created a big block of code conisiting many images and links, which I need to change from time to time. Because this was built with a plugin like Elementor manually changing hundreds of images/links would take forever.
If I could edit the source code of just this page I would copy the source code, run it through my script which would change all the links/images in seconds and paste it back in the webpage source code.
If this wasn't clear enough hear is my thought process in steps:
1: Having a webpage with content which can only (afaik) be edited through a plugin like Elementor
2: Instead copying the part with the content from the source code
3: Chaging this source code within seconds through a script
4: Pasting the new source code back into the webpage sp it is updated with the new content
Ok, so it depends on how elementor is storing the images in the image block, chances are that is will be contained in shortcodes e.g. [vietpic]<img src="wp-content/nam.jpg [/vietpic] you should be able to see this by going to the page with these images and then selecting 'Text' on the content editor. The editor will switch from the visual blockbuilding to the code which you can then copy out, run your script on and place elsewhere. Just make sure that you get the whole block, like any containing elements for instance. If this doesn't work out I'd suggest navigating to the page on the frontend, inspecting the element via the browsers inspector then selecting the container, click 'edit as html' then copy out the code. You can then run your script on this source code then paste it into an elementor custom html block.

render static content of html page using text file

I have a scenario where I need to create simple html page having large amount of text.So i want to make use of some text file,which I can have in my content folder of mvc vb.net solution.so next time,if i want to change my content ,I can change in that text file only.I can only use java script and html to achieve this.
I tried using java script to load file and that is not working.
You can solve it via JavaScript but in a very crude way. Yuo would need to write a script that requests the text file via AJAX and then puts the resulting content into a specific tag on the current page.

Copy content of a page into excel by preserving the formatting

I have a page in angular js. There is a table like view on the page. This has been achieved using div tags and not a table tag. After copying this content into excel , its formatting changes. It does not get copied as it is.Any changes I can do in HTML file to copy it exactly how it is on the webpage?
In case you need a full copy of the table - you could create a separate "view" on the same page with a proper table markup (placed outside of viewport). And have a button to "copy table"
with code attached that will put your table into clipboard.
Another guess is that you had to switch to divs because table markup didn't allow you something. In that case - look at handsontable library for google docs like tables.
They have a community version and there is some bridge for angular as well. Maybe it'll do you some good.

Adding a .css file into sharepoint

I am trying to include this line of html into a sharepoint 2007 content section inside a page i have just created. I am the owner.
<link rel="stylesheet" type="text/css" href="/sites/gskglobal/mcLaren-partnership/Documents/live.css" />
I input this using Edit HTML Source on a piece of content (This was the only way i could find out how to input HTML directly).
When i click ok the styles display perfectly having already uploaded the css file.
When i click save it removes the entire link element and leaves me with no stylesheet.
i could put the styles in line, but i really don't want to do this.
N.B no erros are displayed only
Warning: The HTML source you entered might have been modified.
Both of those will work, however the CSS may get executed AFTER the SharePoint Page is rendered.
The short and simple way is to add the CSS file to any document library (Style Library too). Add the Link script above into a text file and upload that. Add a Content Editor Web Part to the page and through the settings, point it to the TEXT file with the script.
The CEWP part is executed during the HTML creation process when building the page thus the CSS gets executed with the header (like the rest of the CSS for SharePoint).
Try adding your .css file to your main web "Style Library"
You need only to publish your css file
Go to your all document view
find your file
publish
The best and easiest way I found to add any form of html into the document when adding a webpart simply add a form then edit the html as you would normally and this will no longer give you the
Warning: The HTML source you entered might have been modified.
It will just leave the markup in there without sharepoint stripping or editing your markup
Just wanted to make people aware that this is possible and maybe an option if you don't have access to the other suggests.

How to locate/edit the original source html of an aspx page on a sharepoint site

I am working with a MOSS 2007 site, the page I am currently trying to make additions/changes to specifically is a popup.
The page is an .aspx file and I know where it is located, but simply put I am trying to find and ultimately modify the original source html of this page(the html which shows up when you hit "view source" when brought up in my browser).
When i try to edit the page in sharepoint designer It only brings up a formatted view of the html code, I wish to see a much more complete version where i can edit the attributes of the tags and such.
Is there anyway to locate this original source html?
Try using CTRL + F to do quick find and then search your HTML tag id or any descriptive text you can find from viewing source or expecting the element. And then select Search Entire Solution or Current Project.
If the project is set up with a MVC structure, try finding
MainFolder/ProjectName_Web/Views
Alternately look in
MainFolder/ProjectName_Web/UserControls
If you are using Visual Studio, check out Kris Hollenbeck's solution.