VBA scrapping of USPTO website

ScooterNorm

New Member
Joined
Feb 25, 2024
Messages
22
Office Version
  1. 2016
Platform
  1. Windows
Excel Version (Office 2016)

Excel Environment (desktop, Windows)

Knowledge Level - Intermediate level

I'm trying to scrape off the USPTO website. When I do a manual search the URL is: https://tsdr.uspto.gov and I enter a serial number (i.e. 79349658), press the status button and the search is executed and the results are returned.

The resulting URL of the search page is:

https://tsdr.uspto.gov/#caseNumber=...TION&caseType=DEFAULT&searchType=statusSearch

When I try to execute this with VBA, it returns the tsdr.uspto.gov web page, not the result of the search. Any idea what I'm doing wrong?

Here's the code,

Sub Test()
Dim ht As HTMLDocument
Dim IE As InternetExplorer

Set IE = New InternetExplorer
IE.Visible = True
IE.navigate ("Trademark Status & Document Retrieval" & _
"&caseSearchType=US_APPLICATION" & _
"&caseType=DEFAULT" & _
"&searchType=statusSearch")

Do Until IE.readyState = READYSTATE_COMPLETE And IE.Busy = False
DoEvents
Loop

Set ht = IE.document

'IE.Quit

End Sub
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
Try...

VBA Code:
IE.navigate "https://tsdr.uspto.gov/" & _
    "#caseNumber=79349658" & _
    "&caseSearchType=US_APPLICATION" & _
    "&caseType=DEFAULT&searchType=statusSearch"

Hope this helps!
 
Upvote 0
Thanks Dominic,
Yes, that's what I tried. It returns the Search screen as if you entered tsdr.uspto.gov
My post is messed up and I can't figure out how to edit my post.
 
Upvote 0
Actually, in your code, you didn't include the case number, as I did in mine...
 
Upvote 0
Actually, in your code, you didn't include the case number, as I did in mine...
actually I did include the serialno. That’s one of the things messed up on post which I can’t figure out how to fix. But my VBA code has the serialno.
 
Upvote 0
When I try my code, it returns the status result.

If you don't see an "Edit" option/button, you don't have the option to edit your post. In that case, try posting the navigate portion again, but this time make sure that you post them between code tags. You should see a button that looks like this </> on the toolbar above the message area.
 
Upvote 0
When I try my code, it returns the status result.

If you don't see an "Edit" option/button, you don't have the option to edit your post. In that case, try posting the navigate portion again, but this time make sure that you post them between code tags. You should see a button that looks like this </> on the toolbar above the message area.
Humm when I tried it, it returned the tsdr.uspto.gov page, not the search page result.
Thanks for the tip on using the </> I'll try it here again and post my code:

VBA Code:
Sub Test()
    Dim IE As InternetExplorer

    Set IE = New InternetExplorer

    IE.Visible = True

    IE.navigate ("https://tsdr.uspto.gov/#caseNumber=79349658" &_
                 "&caseSearchType=US_APPLICATION" & _
                 "&caseType=DEFAULT" & _
                 "&searchType=statusSearch")

    Do Until IE.readyState = READYSTATE_COMPLETE And IE.Busy = False
        DoEvents
    Loop

End Sub

Is that the code you tried?
Also, I'm using Excel Version (Office 2016) on Excel Environment (desktop, Windows).

Thanks again for your suggestions,
 
Upvote 0
Excel Version (Office 2016)

Excel Environment (desktop, Windows)

Knowledge Level - Intermediate level

I'm trying to scrape off the USPTO website. When I do a manual search the URL is: https://tsdr.uspto.gov and I enter a serial number (i.e. 79349658), press the status button and the search is executed and the results are returned.

The resulting URL of the search page is:

Trademark Status & Document Retrieval

When I try to execute this with VBA, it returns the tsdr.uspto.gov web page, not the result of the search. Any idea what I'm doing wrong?

Here's the code,

Sub Test()
Dim ht As HTMLDocument
Dim IE As InternetExplorer

Set IE = New InternetExplorer
IE.Visible = True
IE.navigate ("Trademark Status & Document Retrieval" & _
"&caseSearchType=US_APPLICATION" & _
"&caseType=DEFAULT" & _
"&searchType=statusSearch")

Do Until IE.readyState = READYSTATE_COMPLETE And IE.Busy = False
DoEvents
Loop

Set ht = IE.document

'IE.Quit

End Sub
I’d like to add another point. When I to execute the code with VBA

VBA Code:
IE.navigate ("https://tsdr.uspto.gov/" & _
            "#caseNumber=79349658" & _
            "&caseSearchType=US_APPLICATION" & _
            "&caseType=DEFAULT" & _
            "&searchType=statusSearch")

The case number shows up in the search box and in addition a small x appears on the right hand side of the case number when I navigate to the case number data entry. The same x does not show up when I manually navigate to the page.
 
Upvote 0
The 'x' that appears on the right hand side of the case number is there to allow the user to delete the case number by simply clicking on the 'x'. And whenI try your code, this is what I get...

patent.png


 
Upvote 0

Forum statistics

Threads
1,224,813
Messages
6,181,109
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top