• Categories
  • Recent
  • Popular
  • Users
  • Search
  • FingerprintSwitcher
  • CustomServers
  • AutomationPlugins
Skins
  • Light
  • Default
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Quartz
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Slate
  • Solar
  • Superhero
  • Vapor
Collapse

Bablosoft

How to Avoid Duplicates in Database?

Scheduled Pinned Locked Moved Support
7 Posts 5 Posters 2558 Views
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    mw92
    wrote on last edited by
    #1

    Every 10 minutes I am scraping a news website for new articles and save the Title + Content into a Database. The problem is that instead of ignoring the aready existing Titles/Content it just adds the same entries again below. So how can I avoid that?

    1 Reply Last reply
    1
  • Y Offline
    Y Offline
    yourfriendkarol
    wrote on last edited by
    #2

    good question. out of curiosity i checked databases and tried to check with javascript .match or .IndexOf for a string but it either resulted false or error when string was there.

    I also took list from database and checked with list contains option to see if its there, but it returned false

    1 Reply Last reply
    0
  • Y Offline
    Y Offline
    yourfriendkarol
    wrote on last edited by
    #3

    Ok I managed to do it this way:

    alt text

    be careful for notreuse option

    1 Reply Last reply
    1
  • M Offline
    M Offline
    mw92
    wrote on last edited by
    #4

    Thank you! Will try it now

    1 Reply Last reply
    0
  • Z Offline
    Z Offline
    zw
    wrote on last edited by
    #5

    I have the same problem.

    Unfortunately I don't see how the string matches regex function can help.
    It allows to check a variable, but I don't see how I could check all the records in a table?

    Any ideas or other solutions?

    hellomembershaH 1 Reply Last reply
    0
  • hellomembershaH Offline
    hellomembershaH Offline
    hellomembersha
    replied to zw on last edited by
    #6

    @zw Were you able to find a way around it?

    1 Reply Last reply
    0
  • BAS Viet NamB Offline
    BAS Viet NamB Offline
    BAS Viet Nam GURU BAS
    wrote on last edited by
    #7

    There are many ways to handle this issue. I'll show you one way.

    For a news website, it's almost impossible for recently added articles to have 100% identical content. Therefore, you just need to compare the latest data added to your database with the data you're checking. If they are 100% identical, then the data has already been added, so you can skip it and check the next piece of data using the same process.

    So, for your request, you can convert the database to a list format, then retrieve the last element corresponding to the latest data added (or you can retrieve the latest data directly from the database if you know how to work with databases). Use Parse CSV string to parse the string into article title and content.

    You can compare the title of the latest article with the title you're checking. If they are 100% identical, then it has already been added to the database. If you want to be more certain, you can also compare the content (although this may not be necessary).

    I hope you understand what I'm saying.

    💻 Work with Reputation, Speed, and Quality
    🤙 Telegram : https://t.me/basvietnam
    💻 Website : https://basvietnam.com/
    📞 WhatsApp : https://wa.me/84973590048
    🎦 Youtube : https://www.youtube.com/@basvietnam/videos

    1 Reply Last reply
    0

  • G

    Move And Click On Element with MATCH error duplicate value

    Scheduled Pinned Locked Moved Support
    0 Votes
    1 Posts
    490 Views
    No one has replied
  • Pavel Duglas BasP

    URL MODULE + DATABASE MODULE

    Scheduled Pinned Locked Moved Support
    -1 Votes
    1 Posts
    611 Views
    No one has replied
  • Y

    syncing databases folder with cloud

    Scheduled Pinned Locked Moved Support
    0 Votes
    1 Posts
    556 Views
    No one has replied
  • Y

    Is File Resource More Computer-Heavy Task Than Database-Resource?

    Scheduled Pinned Locked Moved Support
    0 Votes
    1 Posts
    773 Views
    No one has replied
  • Y

    Does googledrive upload, also uploads database structure and data?

    Scheduled Pinned Locked Moved Support
    0 Votes
    1 Posts
    714 Views
    No one has replied
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Popular
  • Users
  • Search
  • FingerprintSwitcher
  • CustomServers
  • AutomationPlugins
  • Login

  • Don't have an account? Register

  • Login or register to search.