html/DOM manipulation

aleksa77

Client
Регистрация
30.09.2011
Сообщения
914
Благодарностей
90
Баллы
28
I need to cut and remove some part of website and then load it without this parts, i can this do with C# ?

thanks
 

lokiys

Moderator
Регистрация
01.02.2012
Сообщения
4 770
Благодарностей
1 181
Баллы
113
You can cut css files from loading, you can cut javascript file from loading only using links.
If You want to load just half of the page what loads by one url then I believe it's not possible.
You can still save DOM in txt file with your needed parts and load that way.
You can not tell the webserver to load what you want from the server. if that's what you mean.
 

aleksa77

Client
Регистрация
30.09.2011
Сообщения
914
Благодарностей
90
Баллы
28
yes, i want to hide for example all h2 tags and load page without them, visually to load page without it I remember some plugin for html manipulation and you can cut what you want but it is after load.
 
Последнее редактирование:

Merciless

Новичок
Регистрация
12.09.2019
Сообщения
19
Благодарностей
3
Баллы
3
You can't affect the HTML that the server sends you before browser get this, for sure not in zennoposter.

So i have two options (one is concept :D)

First:
is to make a GET request to your page, grab whole body (HTML) and cut elements that you want to affect but i don't know is there any possibility to inject custom HTML to browser in zennoposter (maybe you don't want to use browser).

Second:
you can combine below functions with onload event, that will give you chance to affect html before client will see anything.
below code hidding elements (for example h2 tag) with jQuery or javascript:

JavaScript:
jQuery:
jQuery("h2").hide();

Javascript:
elements = document.getElementsByTagName("h2");

for(var i = 0; i < elements.length; i++)
{
    elements[i].style.display = "none";
}
Could you provide more informations about your problem?
 
  • Спасибо
Реакции: lokiys и aleksa77

aleksa77

Client
Регистрация
30.09.2011
Сообщения
914
Благодарностей
90
Баллы
28
Thanks for useful info, i just grabing info to send clear specification for someone who can do it. I have some target website, this website need to load and client need to see it he must see some important info into body , but without header, footer and h2 links / tags . for example this page of forum, client must see only text on current thread without logo, header of this forum/script .
 

Merciless

Новичок
Регистрация
12.09.2019
Сообщения
19
Благодарностей
3
Баллы
3
So i think that jQuery or javascript with hidding element on event "onload" should be enough.
 
  • Спасибо
Реакции: aleksa77

Кто просматривает тему: (Всего: 1, Пользователи: 0, Гости: 1)