Search entire website's source for specific code

799 views
Skip to first unread message

Sarla Scherlis

unread,
Jun 23, 2020, 7:02:29 PM6/23/20
to Chrome DevTools
I am looking for a way to view an entire website's source with the goal of locating code contained there. For right now, I can only view each page's source individually, and this method is extremely time-consuming with so many pages. Is there a method within DevTools that will allow me to search what I'm looking for through all of the website's source code?

PhistucK

unread,
Jun 23, 2020, 7:11:34 PM6/23/20
to Google Chrome Developer Tools
Not using the Developer Tools.

The closest you can get is pressing Control + Shift + F in the Developer Tools. That will bring up the global search which searches across all of the HTML, CSS and JavaScript files that are used on the current tab (including frames/iFrames).

PhistucK


On Wed, Jun 24, 2020 at 2:02 AM Sarla Scherlis <scherl...@gmail.com> wrote:
I am looking for a way to view an entire website's source with the goal of locating code contained there. For right now, I can only view each page's source individually, and this method is extremely time-consuming with so many pages. Is there a method within DevTools that will allow me to search what I'm looking for through all of the website's source code?

--
You received this message because you are subscribed to the Google Groups "Chrome DevTools" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-chrome-develo...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-chrome-developer-tools/4ee28a01-f930-4457-8d6d-1035eb83d28do%40googlegroups.com.

Sarla Scherlis

unread,
Jun 23, 2020, 7:32:41 PM6/23/20
to Chrome DevTools
Thank you for the response. I know this is a Google forum, but would you happen to know of other methods that might allow me to do something like this?


On Tuesday, June 23, 2020 at 6:11:34 PM UTC-5, PhistucK wrote:
Not using the Developer Tools.

The closest you can get is pressing Control + Shift + F in the Developer Tools. That will bring up the global search which searches across all of the HTML, CSS and JavaScript files that are used on the current tab (including frames/iFrames).

PhistucK


On Wed, Jun 24, 2020 at 2:02 AM Sarla Scherlis <scherl...@gmail.com> wrote:
I am looking for a way to view an entire website's source with the goal of locating code contained there. For right now, I can only view each page's source individually, and this method is extremely time-consuming with so many pages. Is there a method within DevTools that will allow me to search what I'm looking for through all of the website's source code?

--
You received this message because you are subscribed to the Google Groups "Chrome DevTools" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-chrome-developer-tools+unsub...@googlegroups.com.

herb munson

unread,
Jun 23, 2020, 8:16:06 PM6/23/20
to google-chrome-...@googlegroups.com
Notepad++ will look through a (sub-)set of files/folders, though there are probably more sophisticated solutions 🤔😷

Herb Munson
Ballard WA

Sent from the awful Google gmail client (terrible editor) over T-MOBILE's sketchy network

On Tue, Jun 23, 2020, 4:02 PM Sarla Scherlis <scherl...@gmail.com> wrote:
I am looking for a way to view an entire website's source with the goal of locating code contained there. For right now, I can only view each page's source individually, and this method is extremely time-consuming with so many pages. Is there a method within DevTools that will allow me to search what I'm looking for through all of the website's source code?

--
You received this message because you are subscribed to the Google Groups "Chrome DevTools" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-chrome-develo...@googlegroups.com.

guest271314

unread,
Jun 23, 2020, 10:46:29 PM6/23/20
to Chrome DevTools
One option is to navigate to Network tab, right click on an entry, select Save all as HAR with content, open .har file in text editor or at a Chromium, then press Ctrl F.

Sarla Scherlis

unread,
Jun 25, 2020, 1:43:54 PM6/25/20
to Chrome DevTools
I do not see any entries. What does this method do?

guest271314

unread,
Jun 25, 2020, 10:08:08 PM6/25/20
to Chrome DevTools
Open DevTools => Network => Select All => Refresh page (if necessary) => See "Name Status Type Initiator Size" => Right click => Select "Save all as HAR with content" 

Sarla Scherlis

unread,
Jun 26, 2020, 12:41:08 AM6/26/20
to Chrome DevTools
I tried that method, and it seems to be more of a diagnostic method, but I'm unable to do what I'm thinking of. Is it possible to see the source code for the entire website without going through each page and looking at it individually?

guest271314

unread,
Jun 26, 2020, 1:26:47 AM6/26/20
to Chrome DevTools
> Is it possible to see the source code for the entire website without going through each page and looking at it individually?

Am not sure what you mean. To see the entire source code necessitates inclusion of each page individually. The .har file should contain all of the content within the request. An excerpt from the .har file from this page

"content": {
            "size": 436,
            "mimeType": "text/html",
            "text": "<!DOCTYPE html>\n<html>\n<head>\n<title></title>\n<meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\" />\n<script type=\"text/javascript\" nonce=\"DKntdgzNk+XiWGzIrAjqDQ==\">\n  window['startup'] = function() {\n    googleapis.server.init();\n  };\n</script>\n<script type=\"text/javascript\"\n  src=\"https://apis.google.com/js/googleapis.proxy.js?onload=startup\" async\n  defer nonce=\"DKntdgzNk+XiWGzIrAjqDQ==\"></script>\n</head>\n<body>\n</body>\n</html>\n"
          }

PhistucK

unread,
Jun 26, 2020, 2:30:27 AM6/26/20
to Google Chrome Developer Tools
Not with the Developer Tools. There are web scraping applications/libraries/scripts but even they only download everything they find using links and maybe simple form submissions.
There is no way to get everything a website holds if it does not expose it in a relatively straightforward way.

PhistucK


--
You received this message because you are subscribed to the Google Groups "Chrome DevTools" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-chrome-develo...@googlegroups.com.

scherl...@gmail.com

unread,
Jun 28, 2020, 11:24:13 PM6/28/20
to Chrome DevTools
Well, this response for an earlier similar question is what sparked my curiosity on this topic: "It is only going to search what sources it knows about. By default, the DevTools only knows about the code of any given page it is on. You may use the Workspaces feature to reveal the entire site's source code to the DevTools and it should then look over everything." It seems as though Workspaces is no longer being maintained and wanted to see what options I had now to search through the source code of an entire website.

PhistucK

unread,
Jun 29, 2020, 2:17:52 AM6/29/20
to Google Chrome Developer Tools
I think workspaces are maintained, but they only help if the website is yours (you have the source code), in which case, any file searching utility would also work (except for dynamic parts that are part of the loaded page in the browser).

PhistucK


--
You received this message because you are subscribed to the Google Groups "Chrome DevTools" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-chrome-develo...@googlegroups.com.

scherl...@gmail.com

unread,
Jun 29, 2020, 8:49:54 AM6/29/20
to Chrome DevTools
Noted. Would a full static website change anything?

PhistucK

unread,
Jun 29, 2020, 8:54:57 AM6/29/20
to Google Chrome Developer Tools
If you own it, it is easier (Notepad++ or any other file content search would work). If you do not own it, it does not change a lot.

PhistucK


scherl...@gmail.com

unread,
Jun 29, 2020, 11:34:10 PM6/29/20
to Chrome DevTools
Since the website in question here is too large to be downloaded offline and I do not own it, what do you recommend I do?

PhistucK

unread,
Jun 30, 2020, 1:20:30 AM6/30/20
to Google Chrome Developer Tools
No recommendation and out of scope for this group, sorry.

PhistucK


Reply all
Reply to author
Forward
0 new messages